Lab 3_2014.doc

advertisement
Lab 3 2014:
One way ANOVA In SAS
The following is a typical data step for putting in data:
data filterdata;
input filter $ flowrate;
cards;
A 8.41
A 8.19
A 8.59
A 7.97
B 7.43
B 6.97
B 7.49
B 7.03
C 7.69
C 7.22
C 7.41
C 7.84
D 7.85
D 8.31
D 8.49
D 7.75
E 8.77
E 8.82
E 8.41
E 8.36
F 6.87
F 7.25
F 7.41
F 6.87
;
run;
Finding the means:
proc means data=filterdata;
class filter;
var flowrate;
run;
PROC GLM (for general Linear model is a powerful procedure and allows us to
do ANOVA and multiple comparison. It also allows us save our residuals for
plotting.
proc glm data=filterdata;
class filter;
model flowrate=filter;
lsmeans filter / alpha=0.05 pdiff cl;
/*All pairwise tests and confidence intervals using Tukey's method*/
lsmeans filter / alpha=0.05 adjust=tukey pdiff cl;
/*All pairwise tests and confidence intervals using Scheffe's method and
test for equal varaince*/
lsmeans filter / alpha=0.05 adjust=scheffe pdiff cl;
/*All pairwise tests and confidence intervals using Bonferroni's method and
test for equal varaince*/
means filter / hovtest=bf alpha=0.05 bon cldiff;
/*Compare all treatments to the control treatment labeled F*/
means filter / alpha=0.05 dunnett('F');
output out=new p=predict r=resid;
run;
/*plot your residual vs predicted*/
proc gplot data=new;
plot resid*predict;
run;
/*getting histograms and normal probability plot*/
proc capability data=new normaltest;
var resid;
histogram;
qqplot;
run;
Lab Exercise: Do the following problem using SAS:
Some investigators think that the concentration (mg/ml) of a particular antigen in supernatant fluids could be
related to the onset of meningitis in infants. The accompanying data is typical of that given in plots appearing in
the paper “Type-Specific Capsular Antigen is Associated with virulence in Late-Onset Group B Streptococcal Type III
Disease” (Infection and Immunity(1984):124-129)
Asymptomatic infants
Infants with late onset sephis
Infants with late onset meningitis
1.56
1.51
1.21
1.06
1.78
1.34
.87
1.45
1.95
1.39
1.13
2.00
.71
1.87
2.27
Is there a difference among the groups?
Provide the ANOVA table?
Use Tukey’s and Fisher’s method to discuss difference among the three groups.
Discuss assumptions and violations of such.
.87
1.89
.88
.95
1.07
1.67
1.51
1.72
2.57
Download