Published on :
Statistical CREATION_INTERNE

Mixed Model Analysis (GLM and MIXED)

This code is also available in: Deutsch Español Français
Awaiting validation
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.
Copied!
1DATA machine;
2 INPUT machine person rating;
3 DATALINES;
41 1 52.0 1 2 51.8 1 2 52.8 1 3 60.0 1 4 51.1 1 4 52.3 1 5 50.9
51 5 51.8 1 5 51.4 1 6 46.4 1 6 44.8 1 6 49.2 2 1 64.0 2 2 59.7
62 2 60.0 2 2 59.0 2 3 68.6 2 3 65.8 2 4 63.2 2 4 62.8 2 4 62.2
72 5 64.8 2 5 65.0 2 6 43.7 2 6 44.2 2 6 43.0 3 1 67.5 3 1 67.2
83 1 66.9 3 2 61.5 3 2 61.7 3 2 62.3 3 3 70.8 3 3 70.6 3 3 71.0
93 4 64.1 3 4 66.2 3 4 64.0 3 5 72.1 3 5 72.0 3 5 71.1 3 6 62.0
103 6 61.4 3 6 60.5
11;
2 Code Block
PROC GLM
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!
1PROC GLM DATA=machine;
2 class machine person;
3 model rating=machine person machine*person;
4 random person machine*person / test;
5RUN;
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!
1PROC MIXED DATA=machine method=type3;
2 class machine person;
3 model rating = machine;
4 random person machine*person;
5RUN;
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.
Copyright Info : S A S S A M P L E L I B R A R Y