The script begins by creating a dataset named 'machine' using a DATA STEP and embedded data via the DATALINES statement. This dataset contains information on different machines, persons, and their ratings. Subsequently, two statistical procedures are applied: PROC GLM and PROC MIXED. PROC GLM is used for an analysis of variance where the 'person' effects and the 'machine*person' interaction are treated as random effects. PROC MIXED, specifically designed for mixed models, performs a similar analysis with 'machine' as a fixed effect and 'person' and 'machine*person' as random effects, using the TYPE3 method for parameter estimation.
Data Analysis
Type : CREATION_INTERNE
The 'machine' dataset is created internally and directly populated within the SAS script using a DATA STEP and the DATALINES statement, ensuring that all necessary data is contained within the script.
1 Code Block
DATA STEP Data
Explanation : This DATA STEP block creates a SAS dataset named 'machine'. It reads the values of the 'machine', 'person', and 'rating' variables directly from the data provided via the DATALINES statement. This dataset will serve as the basis for subsequent statistical analyses.
Explanation : This PROC GLM procedure performs an analysis of variance on the 'machine' dataset. The 'machine' and 'person' variables are declared as classification variables ('CLASS'). The model specifies 'rating' as the dependent variable, with 'machine', 'person', and their interaction 'machine*person' as effects. The RANDOM statement indicates that 'person' and the 'machine*person' interaction are random effects, and the TEST option requests hypothesis tests for these effects.
Copied!
proc glm data=machine;
class machine person;
model rating=machine person machine*person;
random person machine*person / test;
run;
1
PROC GLMDATA=machine;
2
class machine person;
3
model rating=machine person machine*person;
4
random person machine*person / test;
5
RUN;
3 Code Block
PROC MIXED
Explanation : This PROC MIXED procedure performs a mixed model analysis on the 'machine' dataset, using the 'TYPE3' method for calculating sums of squares. The 'machine' and 'person' variables are defined as classification variables ('CLASS'). The model specifies 'rating' as the dependent variable and 'machine' as a fixed effect. The random effects are 'person' and the 'machine*person' interaction. This procedure is more specifically designed for the analysis of linear mixed models.
Copied!
proc mixed data=machine method=type3;
class machine person;
model rating = machine;
random person machine*person;
run;
1
PROC MIXEDDATA=machine method=type3;
2
class machine person;
3
model rating = machine;
4
random person machine*person;
5
RUN;
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.