<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Proc glm looking for effect modification in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-glm-looking-for-effect-modification/m-p/922881#M363367</link>
    <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a data set looking at diabetes and pulmonary function.&amp;nbsp; I want to see whether GOLD&amp;nbsp; (&lt;EM&gt;Global Initiative for Chronic Obstructive Lung Disease&lt;/EM&gt;&lt;SPAN&gt;.)&amp;nbsp;stage (with values from -1 to 4) modifies pulmonary function.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I wrote this code to calculate the change in pulmonary function from the 3rd visit (..._P3) to the first visit (..._P1).&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data working4;
	set working3; 
	change_fev1 = fev1pp_Post_p3 - fev1pp_Post_p1;
	change_fev1_FVC = fev1_FVC_post_p3 - Fev1_FVC_post_p1;
	run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then I wrote this code to see if there was effect modification.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Proc GLM data=working4; &lt;BR /&gt;class finalgold_P3 (ref='GOLD 0');&lt;BR /&gt;model finalgold_p3 = finalgold_P3 change_fev1 change_fev1_FVC; *finalgold_p3*change_fev1 finalgold_p3*change_fev1_FVC;&lt;BR /&gt;lsmeans finalgold_P3 change_fev1 change_fev1_FVC finalgold_P3*change_fev1_FVC finalgold_P3*change_fev1/ pdiff;&lt;BR /&gt;format finalgold_p3 Final_GOLD_Stage.;&lt;BR /&gt;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But I get this error&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 68         
 69         Proc GLM data=working4;
 70         class finalgold_P3 (ref='GOLD 0');
 71         model finalgold_p3 = finalgold_P3 change_fev1 change_fev1_FVC; *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;
 
 75         
 76         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 86  &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I deleted finalgold_P3 from the right side of the equation but get this error:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; 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;
 86  &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I have finalgold_P3 formatted in previous code as follows.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Proc Format;	
value Final_GOLD_Stage
	-1= "GOLD -1"				
	0 = "GOLD 0" 
	1 = "GOLD 1" 
	2 = "GOLD 2" 
	3 = "GOLD 3" 
	4 = "GOLD 4"
	other = Missing;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Any suggestions are greatly appreciated.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 04 Apr 2024 02:07:51 GMT</pubDate>
    <dc:creator>kristiepauly</dc:creator>
    <dc:date>2024-04-04T02:07:51Z</dc:date>
    <item>
      <title>Proc glm looking for effect modification</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-glm-looking-for-effect-modification/m-p/922881#M363367</link>
      <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a data set looking at diabetes and pulmonary function.&amp;nbsp; I want to see whether GOLD&amp;nbsp; (&lt;EM&gt;Global Initiative for Chronic Obstructive Lung Disease&lt;/EM&gt;&lt;SPAN&gt;.)&amp;nbsp;stage (with values from -1 to 4) modifies pulmonary function.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I wrote this code to calculate the change in pulmonary function from the 3rd visit (..._P3) to the first visit (..._P1).&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data working4;
	set working3; 
	change_fev1 = fev1pp_Post_p3 - fev1pp_Post_p1;
	change_fev1_FVC = fev1_FVC_post_p3 - Fev1_FVC_post_p1;
	run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then I wrote this code to see if there was effect modification.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Proc GLM data=working4; &lt;BR /&gt;class finalgold_P3 (ref='GOLD 0');&lt;BR /&gt;model finalgold_p3 = finalgold_P3 change_fev1 change_fev1_FVC; *finalgold_p3*change_fev1 finalgold_p3*change_fev1_FVC;&lt;BR /&gt;lsmeans finalgold_P3 change_fev1 change_fev1_FVC finalgold_P3*change_fev1_FVC finalgold_P3*change_fev1/ pdiff;&lt;BR /&gt;format finalgold_p3 Final_GOLD_Stage.;&lt;BR /&gt;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But I get this error&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 68         
 69         Proc GLM data=working4;
 70         class finalgold_P3 (ref='GOLD 0');
 71         model finalgold_p3 = finalgold_P3 change_fev1 change_fev1_FVC; *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;
 
 75         
 76         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 86  &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I deleted finalgold_P3 from the right side of the equation but get this error:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; 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;
 86  &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I have finalgold_P3 formatted in previous code as follows.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Proc Format;	
value Final_GOLD_Stage
	-1= "GOLD -1"				
	0 = "GOLD 0" 
	1 = "GOLD 1" 
	2 = "GOLD 2" 
	3 = "GOLD 3" 
	4 = "GOLD 4"
	other = Missing;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Any suggestions are greatly appreciated.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2024 02:07:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-glm-looking-for-effect-modification/m-p/922881#M363367</guid>
      <dc:creator>kristiepauly</dc:creator>
      <dc:date>2024-04-04T02:07:51Z</dc:date>
    </item>
    <item>
      <title>Re: Proc glm looking for effect modification</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-glm-looking-for-effect-modification/m-p/922934#M363380</link>
      <description>&lt;PRE&gt; 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.&lt;/PRE&gt;
&lt;P&gt;This seems pretty clear to me. Only CLASS variables can go in LSMEANS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;I &lt;/SPAN&gt;&lt;SPAN&gt;deleted finalgold_P3 from the right side of the equation but get this error:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Why would you delete finalgold_P3 from the model? it is a variable you are interested in.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt; 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.&lt;/PRE&gt;
&lt;P&gt;Seems pretty clear as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2024 10:29:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-glm-looking-for-effect-modification/m-p/922934#M363380</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-04-04T10:29:58Z</dc:date>
    </item>
  </channel>
</rss>

