Hi,
while running scores data in proc glm, i got zero value for the sum of squares (variable - site, levels L and R ).
is it obvious? i've tried searching internet and found nothing.
i think here there is no problem with the code i've used.
proc glm data=one(where=(hour ne 0));
class subject hour Site;
model score = subject site hour/ ss3;
lsmeans hour /stderr pdiff;
run;
any statistical explanations?
Thanks in advance.
The most likely explanation is that the subjects are nested within sites, so that there are no degrees of freedom for the Site variable. For example look at this simulated data and results:
data one;
do subject = 1 to 54;
if subject < 5 then Site=1;
else Site=2;
do hour=1 to 2;
score = site + hour + rand("normal");
output;
end;
end;
run;
ods select ModelANOVA;
proc glm data=one;
class subject hour Site;
model score = subject site hour/ ss3;
lsmeans hour /stderr pdiff;
run;
quit;
Presumable SITE is constant in your subsample. Consider the same results for SEX below:
proc glm data=sashelp.class (where=(sex='F'));
class age sex;
model height=age sex /ss3;
run;
Consider what @mkeintz said, and run a crosstab on site and hour. I would suggest that one of the sites has all of the hour variables coded in such a way that the where= clause is excluding everything.
Although the results are probably uninteresting for your research problem, what happens when you run the following?
proc glm data=one;
class subject hour Site;
model score = subject site hour/ ss3;
lsmeans hour /stderr pdiff;
run;
Steve Denham
The most likely explanation is that the subjects are nested within sites, so that there are no degrees of freedom for the Site variable. For example look at this simulated data and results:
data one;
do subject = 1 to 54;
if subject < 5 then Site=1;
else Site=2;
do hour=1 to 2;
score = site + hour + rand("normal");
output;
end;
end;
run;
ods select ModelANOVA;
proc glm data=one;
class subject hour Site;
model score = subject site hour/ ss3;
lsmeans hour /stderr pdiff;
run;
quit;
/Homer Simpson voice on
D'oh!
/Homer off
Good point, @Rick_SAS. Much more likely than my guess.
Steve Denham
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.