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

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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