BookmarkSubscribeRSS Feed
alr4655
Calcite | Level 5

Hello,

I'm using SAS studio and I am having a peculiar  problem with proc glm. I am using the below command to perform an ANCOVA looking at the difference between 2 SubjectTypes (cases-214 and controls-87) on the dependent variable (AVG_skel) controlling for  age,sex,and site.

 

proc glm data= sublist plots=meanplot(CL) ;
class SubjectType;
model AVG_Faskel = SubjectType Age_cal sexd sited;
means SubjectType;
lsmeans SubjectType/ stderr pdiff cov out=adjmeans;
run;
quit;

 

For some reason when I run the command the procedure only uses 9/214 cases, but all of the controls. The log has no errors when running the procedure.

 

I have tried doing proc freq to get tables of the SubjectTypes and it reports the correct number in each group so it is not a problem with the class variable. I have also run proc means for the AVG_skel variable and it reports the correct means and number of people in each group.  What's even stranger is that proc glm does work with an earlier version of this file in which the AVG_skel variable has identical values.

 

Any ideas on what could be the problem?

 

I've also included the log output: 

 

 

133
134 proc glm data= sublist plots=meanplot(CL) ;
WARNING: The SAS/STAT product with which GLM is associated will be expiring soon, and is currently in warning mode to indicate this
upcoming expiration. Please run PROC SETINIT to obtain more information on your warning period.
135 class group;
136 model AVG_Faskel = group Age_cal sexd sited;
137 means group;
138 lsmeans group/ stderr pdiff cov out=adjmeans;
139 run;
 
NOTE: Means from the MEANS statement are not adjusted for other terms in the model. For adjusted means, use the LSMEANS statement.
140 quit;
 
NOTE: The data set WORK.ADJMEANS has 2 observations and 7 variables.
NOTE: PROCEDURE GLM used (Total process time):
real time 9.10 seconds
cpu time 0.92 seconds
 
 

 

 

 

3 REPLIES 3
Reeza
Super User

If any of these variables have a missing value, the observation is not used in the GLM procedure.

class SubjectType;
model AVG_Faskel = SubjectType Age_cal sexd sited;

 

You would need to check the missing values for all 5 of the variables. 

 


@alr4655 wrote:

Hello,

I'm using SAS studio and I am having a peculiar  problem with proc glm. I am using the below command to perform an ANCOVA looking at the difference between 2 SubjectTypes (cases-214 and controls-87) on the dependent variable (AVG_skel) controlling for  age,sex,and site.

 

proc glm data= sublist plots=meanplot(CL) ;
class SubjectType;
model AVG_Faskel = SubjectType Age_cal sexd sited;
means SubjectType;
lsmeans SubjectType/ stderr pdiff cov out=adjmeans;
run;
quit;

 

For some reason when I run the command the procedure only uses 9/214 cases, but all of the controls. The log has no errors when running the procedure.

 

I have tried doing proc freq to get tables of the SubjectTypes and it reports the correct number in each group so it is not a problem with the class variable. I have also run proc means for the AVG_skel variable and it reports the correct means and number of people in each group.  What's even stranger is that proc glm does work with an earlier version of this file in which the AVG_skel variable has identical values.

 

Any ideas on what could be the problem?

 

I've also included the log output: 

 

 

133
134 proc glm data= sublist plots=meanplot(CL) ;
WARNING: The SAS/STAT product with which GLM is associated will be expiring soon, and is currently in warning mode to indicate this
upcoming expiration. Please run PROC SETINIT to obtain more information on your warning period.
135 class group;
136 model AVG_Faskel = group Age_cal sexd sited;
137 means group;
138 lsmeans group/ stderr pdiff cov out=adjmeans;
139 run;
 
NOTE: Means from the MEANS statement are not adjusted for other terms in the model. For adjusted means, use the LSMEANS statement.
140 quit;
 
NOTE: The data set WORK.ADJMEANS has 2 observations and 7 variables.
NOTE: PROCEDURE GLM used (Total process time):
real time 9.10 seconds
cpu time 0.92 seconds
 
 

 

 

 



 

PaigeMiller
Diamond | Level 26

You need to actually LOOK at your data, with your own eyeballs. You can use viewtable in SAS or PROC PRINT. Look for missings. That will tell you why you are having this problem.

--
Paige Miller
ballardw
Super User

@PaigeMiller wrote:

You need to actually LOOK at your data, with your own eyeballs. You can use viewtable in SAS or PROC PRINT. Look for missings. That will tell you why you are having this problem.


Or even proc freq which will indicate the number of missing values per variable.

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


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
  • 3 replies
  • 1938 views
  • 0 likes
  • 4 in conversation