options ls=78;
data cls12;
infile 'class12.txt';
input sn gender $ petpref $ lifequal stress;
tstress=(stress)**2;
run;
proc print data=cls12;
run;
proc univariate data=cls12 plot normal;
var lifequal stress tstress;
title 'Chrissy Univariates for All Variables';
run;
proc sort data=cls12;
by gender;
run;
proc univariate data=cls12 plot normal;
by gender;
var lifequal stress tstress;
title 'Chrissy Univariates by Gender for All Variables';
run;
proc anova data=cls12;
class gender;
model lifequal=gender;
means gender/hovtest;
means gender/regwq;
title 'Chrissy ANOVA for Lifequal by Gender';
run;
proc anova data=cls12;
class gender;
model stress=gender;
means gender/hovtest;
means gender/regwq;
title 'Chrissy ANOVA for Stress by Gender';
run;
proc anova data=cls12;
class gender;
model tstress=gender;
means gender/hovtest;
means gender/regwq;
title 'Chrissy ANOVA for tStress by Gender';
run;
proc sort data=cls12;
by petpref;
run;
proc univariate data=cls12 plot normal;
by petpref;
var lifequal stress tstress;
title 'Chrissy Univariate by PetPref for All Variables';
run;
proc anova data=cls12;
class petpref;
model lifequal=petpref;
means petpref/hovtest;
means petpref/regwq;
title 'Chrissy ANOVA for Lifequal by PetPref';
run;
proc anova data=cls12;
class petpref;
model stress=petpref;
means petpref/hovtest;
means petpref/regwq;
title 'Chrissy ANOVA for Stress by PetPref';
run;
proc anova data=cls12;
class petpref;
model tstress=petpref;
means petpref/hovtest;
means petpref/regwq;
title 'Chrissy ANOVA for tStress by PetPref';
run;
proc anova data=cls12;
class gender petpref;
model lifequal=gender petpref gender*petpref;
means gender petpref/regwq;
title 'Chrissy Factorial ANOVA for Lifequal';
run;
proc anova data=cls12;
class gender petpref;
model stress=gender petpref gender*petpref;
means gender petpref/regwq;
title 'Chrissy Factorial ANOVA for Stress';
run;
proc anova data=cls12;
class gender petpref;
model tstress=gender petpref gender*petpref;
means gender petpref/regwq;
title 'Chrissy Factorial ANOVA for tStress';
run;
quit;