SAS 0412
-
Upload
wensheng-chang -
Category
Technology
-
view
1.188 -
download
1
description
Transcript of SAS 0412
SAS tutorial: ANOVA
作業 (目前 )沒有但考試會考的東西
• Full model/reduced model comparison• Multiple comparison• Post hoc analysis (regression)
PROC ANOVA
• CLASS– Names the classification variables to be used in the model.
• MODEL– dependents=effects </ options>
• TEST– TEST <H= effects> E= effect
• MEANS– MEANS effects </ options> – Post hoc analysis for the effects specified.
• REPEATED; ABSORB; BY; FREQ; MANOVA
Example
DataY X1 X2 X3
SAS code
• proc anova data=cream;• class batch position starter;• model acidity=batch position starter;• means batch starter /scheffe;• run;
Result - Data
Result – Analysis of Variance
Result- Scheffe’s test (batch)
Result – Scheffe’s test (starter)
Example: Repeated measure
• 30 people• Interest in voting (5-point scale)• Measured in 10, 15, 20 years old
SAS codedata ex2;
do subject=1 to 30;
do age=1 to 3;
input interest @@;
output;
end;
end;
datalines;
1 1 3
1 1 3
...
proc anova data=ex2;
class age subject;
model interest=age subject age*subject;
test h=age e=age*subject;
run;
Result - Data
Result - ANOVA
Result
test h=age e=age*subject;
Another way
• proc anova data=ex2;• class age subject;• model interest=age subject;• run;
Result - ANOVA
Questions
• ANOVA跟 linear regression的差別• Mean squared error的期望值• Fixed effect/random effect