The 'twoway' dataset used for the analysis is created directly within the SAS script using the DATALINES statement. No external data source or SASHELP library is required for the creation of this dataset.
1 Code Block
DATA STEP Data
Explanation : This DATA STEP block sets a title for the output and creates a dataset named 'twoway'. The data for this dataset is provided directly within the script via the DATALINES statement, which initializes the 'Treatment', 'Block', and 'y' variables with the specified values.
Explanation : This block executes the GLM (General Linear Model) procedure on the 'twoway' dataset. It specifies 'Treatment' and 'Block' as classification variables and models 'y' based on these two factors and their interaction. It also requests the calculation and display of means and least squares means for the 'Treatment' variable. ODS statements are used to control the displayed output elements ('ModelANOVA' and 'Means') and to activate ODS tracing.
Copied!
proc glm data=twoway;
class Treatment Block;
model y = Treatment | Block;
means Treatment;
lsmeans Treatment;
ods select ModelANOVA Means;
ods trace on;
ods show;
run;
ods show;
quit;
ods show;
1
PROC GLMDATA=twoway;
2
class Treatment Block;
3
model y = Treatment | Block;
4
means Treatment;
5
lsmeans Treatment;
6
ods select ModelANOVA Means;
7
ods trace on;
8
ods show;
9
RUN;
10
11
ods show;
12
QUIT;
13
ods show;
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.