BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
satish123
Fluorite | Level 6

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.

 

New Picture.jpg

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.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

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;

View solution in original post

6 REPLIES 6
mkeintz
PROC Star

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;

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------
satish123
Fluorite | Level 6
here in your code, you are using only one level in variable SEX ie 'F'. so, there is no way for the calculation of SS but in my code i'm using two levels for the variable SITE. in DF column it should have show me 1 instead of zero that you can see in the above attached .jpg file.
SteveDenham
Jade | Level 19

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

 

 

Rick_SAS
SAS Super FREQ

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;
SteveDenham
Jade | Level 19

/Homer Simpson voice on

D'oh!

/Homer off

 

Good point, @Rick_SAS.  Much more likely than my guess.  

 

Steve Denham

satish123
Fluorite | Level 6
Thanks for the replies. like Rick_SAS said subjects are nested within the sites in my data.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is ANOVA?

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.

Discussion stats
  • 6 replies
  • 1786 views
  • 5 likes
  • 4 in conversation