BookmarkSubscribeRSS Feed
kristiepauly
Obsidian | Level 7

Hi All, 

My data set is looking at diabetes and pulmonary function over time.  I need to determine whether the GOLD (Global Initiative for Chronic Obstructive Lung Disease) stage (-1 - 4) modifies the effect of pulmonary function.  

I added this code to calculate the change in pulmonary function at visit 3 (....._p3) minus the baseline visit (...._P1)

 

data working4;
	set working3; 
	change_fev1 = fev1pp_Post_p3 - fev1pp_Post_p1;
	change_fev1_FVC = fev1_FVC_post_p3 - Fev1_FVC_post_p1;
	run;

I then used proc glm to try to determine EM. 

Proc GLM data=working4; 
	class finalgold_P3 (ref='GOLD 0');
	model finalgold_p3 = change_fev1 change_fev1_FVC; ***I don't think I need this code....finalgold_p3*change_fev1 finalgold_p3*change_fev1_FVC;
	lsmeans finalgold_P3 change_fev1 change_fev1_FVC finalgold_P3*change_fev1_FVC finalgold_P3*change_fev1/ pdiff;
	format finalgold_p3 final_gold_stage.;
	run;

and get this error message: 

OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 68         
 69         Proc GLM data=working4;
 70         class finalgold_P3 (ref='GOLD 0');
 71         model finalgold_p3 = change_fev1 change_fev1_FVC finalgold_P3; * i don't think i need this here..finalgold_p3*change_fev1 finalgold_p3*change_fev1_FVC;
 72         lsmeans finalgold_P3 change_fev1 change_fev1_FVC finalgold_P3*change_fev1_FVC finalgold_P3*change_fev1/ pdiff;
 ERROR: Only CLASS variables allowed in this effect.
 NOTE: The previous statement has been deleted.
 73         format finalgold_p3 final_gold_stage.;
 74         run;

If I use the same code but delete "finalgold_P3" from the right side of the = sign in the model statement, I get this error message: 

 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 68         
 69         Proc glm data=working4;
 70         class finalgold_P3 (ref='GOLD 0');
 71         model finalgold_p3 = change_fev1 change_fev1_FVC;
 72         lsmeans finalgold_p3 change_fev1 change_fev1_FVC finalgold_P3*change_fev1_FVC finalgold_P3*change_fev1/pdiff;
 ERROR: Effects used in the LSMEANS statement must have appeared previously in the MODEL statement.
 NOTE: The previous statement has been deleted.
 73         format finalgold_P3 final_gold_stage.;
 74         run;
 
 75         
 76         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 
 75         
 76         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;

Any suggestions are greatly appreciated. 

 

 

1 REPLY 1

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 321 views
  • 0 likes
  • 2 in conversation