BookmarkSubscribeRSS Feed
kristiepauly
Obsidian | Level 7

Hello All, 

I'm trying to accomplish two things.

First, I need to change nine variable names and three table headers in an Odds ratio table. I am trying to do that within proc logistic based on others suggestions on this forum but it is not working.  I created another proc logistic before my original code trying to rename the variable (age) and then used "parmlabel" in my original proc logistic code. Code and error are below.  

proc logistic data=working3 descending;
	age_P3 = Age;
	run;
proc logistic data=working3 descending;  
	age_P3 = Age / parmlabel;  
  	class diabetes_P3 (ref ='No') finalgold_P3 (ref='GOLD 0') race (ref='1') Gender(ref='1');
  	model finalgold_P3(event='GOLD 0') = diabetes_P3 age_P3  BMI_P3 highbloodpres_P3 highcholest_P3
  		cortsterinhal_P3 cortsteroral_P3 smokcignow_P3 gender/ link=glogit;
  	format finalgold_p3 final_gold_stage. diabetes_P3 diabetes_baseline. BMI_P3 
  		BMI_group. highbloodpres_P3 highbloodpres_group. highcholest_P3 highcholest_group. smokcignow_P3 smokcignow_group.
  		cortsterinhal_P3 cortsterinhal_group. cortsteroral_P3 cortsteroral_group. finalgold_P3 Baseline_GOLD_Stage.;
run;
LOG REPORT:
69         proc logistic data=working3 descending;
 70         age_P3 = Age;
             ______
             180
 ERROR 180-322: Statement is not valid or it is used out of proper order.
 71         run;

 

Second, I need to reorder the finalGOLD_P3 category from PRISm to GOLD 4 instead of GOLD 1 to PRISm. 

 

kristiepauly_0-1713729194879.png

Any suggestions?  

 

 

 

 

 

 

 

 

4 REPLIES 4
PaigeMiller
Diamond | Level 26

There is no such statement that appears to equate one variable to another within PROC LOGISTIC.

 

age_P3 = Age;

 

Not sure what you are trying to do with the above statement.

 

If you want a table in a specific order, probably best if you use ODS OUTPUT to create the table as a SAS data set, sort it in whatever order you want, and then run PROC PRINT.

--
Paige Miller
kristiepauly
Obsidian | Level 7

I am trying to see if there is a difference in the change in pulmonary function in people with diabetes vs those without over a 10 year time period.  I wrote this to calculate the change.

 

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

I used proc glm to give me the type III table and the interaction plot for change in fev1pp. 

 

 

proc glm data=working4;
	class diabetes_P1(ref='No') finalgold_P1 (ref='GOLD 0');
	model change_fev1pp = diabetes_P1 finalgold_p1 diabetes_P1*finalgold_p1;
	lsmeans diabetes_P1 finalgold_p1 diabetes_P1*finalgold_p1 / pdiff;
	format finalgold_p1 baseline_gold_stage. diabetes_P1 diabetes_baseline.;
	run;

Here is the output I get: 

 

Screenshot 2024-04-21 160243.png

I need this same output but after I adjust for several variables (age, gender, bmi, high bp, high cholesterol, corticosteroid use, smoking status). I first tried to do this using Proc glm

proc glm data=working4;
	class diabetes_P1(ref='No') finalgold_P1(ref='GOLD 0') Gender(ref='1') BMI_P1(ref='Healthy')
	highbloodpres_P1(ref='No') highcholest_P1(ref='No')
  		cortsterinhal_P1(ref='No') cortsteroral_P1(ref='No') smokcignow_P1(ref='No');
	model change_fev1pp = diabetes_P1 finalgold_P1 diabetes_P1*finalgold_P1
	 BMI_P1 highbloodpres_P1 highcholest_P1 age_P1
  		cortsterinhal_P1 cortsteroral_P1 smokcignow_P1 gender;
	lsmeans diabetes_P1 finalgold_p1 diabetes_P1*finalgold_p1 / pdiff;
	format finalgold_P1 final_gold_stage. diabetes_P1 diabetes_final. BMI_P1 
  		BMI_group. highbloodpres_P1 highbloodpres_group. highcholest_P1 highcholest_group. smokcignow_P1 smokcignow_group.
  		cortsterinhal_P1 cortsterinhal_group. cortsteroral_P1 cortsteroral_group.;
	run;

and I get the type III table but not the interaction plot. Is this interaction plot not possible when including variables I'm adjusting for or did I do it wrong?  Is there a better visual representation to show the change in fev1pp by GOLD stage over 10 years time in people with diabetes vs without? 

 

I also tried to adjust for the variables in proc logistic, but that wasn't right either. 

 

proc logistic data=working4;
  	class diabetes_P1 (ref ='No') finalgold_P1 (ref='GOLD 0') race (ref='1') Gender(ref='1') BMI_P3(ref='Healthy')
	highbloodpres_P3(ref='No') highcholest_P3(ref='No') 
  		cortsterinhal_P3(ref='No') cortsteroral_P3(ref='No') smokcignow_P3(ref='No');
  	model change_fev1pp = diabetes_P1 finalgold_p1 diabetes_P1*finalgold_p1
  		age_P3  BMI_P3 highbloodpres_P3 highcholest_P3
  		cortsterinhal_P3 cortsteroral_P3 smokcignow_P3 gender/ link=glogit;
  		lsmeans diabetes_P1 finalgold_p1 diabetes_P1*finalgold_p1 / pdiff;
  	format finalgold_p1 final_gold_stage. diabetes_P1 diabetes_baseline. BMI_P3 
  		BMI_group. highbloodpres_P3 highbloodpres_group. highcholest_P3 highcholest_group. smokcignow_P3 smokcignow_group.
  		cortsterinhal_P3 cortsterinhal_group. cortsteroral_P3 cortsteroral_group. finalgold_P3 Baseline_GOLD_Stage.;
run;

But get this error.

 

 ERROR: Computations are terminated because the number of response levels, 614, exceeds MAXRESPONSELEVELS=100.
 NOTE: The SAS System stopped processing this step because of errors.
 NOTE: There were 2864 observations read from the data set WORK.WORKING4.
 NOTE: PROCEDURE LOGISTIC used (Total process time):
       real time           0.19 seconds
       user cpu time       0.17 seconds
       system cpu time     0.02 seconds
       memory              33575.15k
       OS Memory           61600.00k
       Timestamp           04/21/2024 10:06:27 PM
       Step Count                        525  Switch Count  0
       Page Faults                       0
       Page Reclaims                     8318
       Page Swaps                        0
       Voluntary Context Switches        0
       Involuntary Context Switches      0
       Block Input Operations            0
       Block Output Operations           40
       
 81         
 82         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;

Thanks. 

PaigeMiller
Diamond | Level 26

You have asked questions unrelated to your first post in this thread and unrelated to the subject of this thread. Please start a new thread, with some Subject like "Interaction Plots" so anyone who has a similar problem can find your new thread.

--
Paige Miller
kristiepauly
Obsidian | Level 7

I apologize.  I was doing too many things at once. 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 266 views
  • 0 likes
  • 2 in conversation