The script begins with a DATA STEP that generates the 'FerriteCores' dataset. This dataset simulates 'MagneticForce' measurements for four levels of 'Temp' (temperature), with five repetitions per level, the data being provided via DATALINES. Then, PROC MIXED is invoked to perform an analysis of variance on 'MagneticForce' as a function of 'Temp'. The CLASS statement specifies 'Temp' as a categorical variable. The LSMESTIMATE statement is used to define and test specific isotonic contrasts, allowing comparison of mean 'Temp' levels in an ordered manner. The '/ adjust=simulate(seed=1) cl upper' options are applied for p-value adjustment, calculation of confidence intervals, and definition of an upper bound. Finally, ODS SELECT LSMestimates is used to display only the relevant results of the least squares estimates.
Data Analysis
Type : INTERNAL_CREATION
Data is generated directly within the script via a DATA STEP and DATALINES for the 'FerriteCores' dataset. The 'MagneticForce' field is read from the DATALINES.
1 Code Block
DATA STEP Data
Explanation : This DATA STEP block creates the 'FerriteCores' dataset. It initializes a loop to generate a 'Temp' (temperature) variable from 1 to 4, and an inner loop for 5 repetitions per 'Temp'. The 'MagneticForce' variable is read from DATALINES, simulating measurements for different temperature conditions.
Copied!
data FerriteCores;
do Temp = 1 to 4;
do rep = 1 to 5; drop rep;
input MagneticForce;
output;
end;
end;
datalines;
10.8 9.9 10.7 10.4 9.7
10.7 10.6 11.0 10.8 10.9
11.9 11.2 11.0 11.1 11.3
11.4 10.7 10.9 11.3 11.7
;
1
DATA FerriteCores;
2
DO Temp = 1 to 4;
3
DO rep = 1 to 5; drop rep;
4
INPUT MagneticForce;
5
OUTPUT;
6
END;
7
END;
8
DATALINES;
9
10.89.910.710.49.7
10
10.710.611.010.810.9
11
11.911.211.011.111.3
12
11.410.710.911.311.7
13
;
14
2 Code Block
PROC MIXED
Explanation : This block uses PROC MIXED to analyze the 'FerriteCores' dataset. 'Temp' is defined as a classification variable. A model is specified with 'MagneticForce' as the response and 'Temp' as the predictor. The LSMESTIMATE statement is used to test isotonic contrasts, evaluating ordered hypotheses on the means of 'Temp' levels. Options include p-value adjustment by simulation, calculation of confidence intervals, and specification of an upper bound. ODS SELECT LSMestimates limits the output to the least squares estimates results.
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.