BookmarkSubscribeRSS Feed
Heejeong
Obsidian | Level 7

Hello,

 

I am currening a simple PROC GLM using the syntax below. I have a long list of covariates and my main predictor variable is "stressreactivity" and main outcome variable "Norepinephrine." Since proc plm automatically saves and uses the predicted data to plot a figure, I never exported the data. However, my co-author wants to try graphing our data using a different software so asked for the data in an excel file. Is there any way for me to export the data used in the PROC PLM statement to make the final figure?

 

Thank you so much!

 

proc glm data=saved.Final3;
model Norepinephrine=  PerceivedStress cage ClinicSex marriedmidus work race_orig  cedu cHHtotalIncome EverSmokeReg Exercise20mins CNSmeds cBMI cCESD cNeuroticism  cChronCondNumb  cAnyStressWide_sum cpa_mlm2
stressreactivity;
run;
store graph2;run; proc plm restore=graph2 noinfo; effectplot fit (x=stressreactivity)/clm; ods output fitplot=Logfit; run;

Heejeong_1-1657320433357.png

 

 

 

5 REPLIES 5
PaigeMiller
Diamond | Level 26

You can use the SCORE statement in PROC PLM to create an output SAS data set with predicted values. Once you have that output data set, you can export it to Excel.

 

While plotting this data using different software is certainly possible to change the look and feel of the plot, I fail to see how the content (the actual predicted line) will be even the slightest bit different.

--
Paige Miller
Heejeong
Obsidian | Level 7

Thank you so much for your fast response, @PaigeMiller ! Yes, we are expecting the Figure (and the predicted line) to look exactly the same as the current syntax we are using. My co-author just wants to play around with the design (color, font size, etc.)  of the figure rather than the shape of the actual graph!

 

I used the below syntax and added the "store out=saved.PLMdata;". My initial expectation was that this would save a "PLMdata" in my "saved" file. However, I couldn't find such a file and only found a "Logfit" file in the "Work" library (screen shots attached of the icon and the data itself. Would it be safe to assume that "PLMdata" and the "Logfit" files are the same things and I can export the Logfit file? Thank you so much in advance for your response!

 

proc glm data=saved.Final3;
model Norepinephrine= cage ClinicSex marriedmidus work race_orig  cedu cHHtotalIncome EverSmokeReg Exercise20mins CNSmeds cBMI cCESD cNeuroticism  cChronCondNumb  cAnyStressWide_sum cna_mlm2
 csrna_mlm2;
 store out=saved.PLMdata;
run; 

proc plm restore=PLMdata noinfo;
effectplot fit (x=csrna_mlm2)/clm;
ods output fitplot=Logfit;
run;

Heejeong_0-1657323584266.png

 

 

PaigeMiller
Diamond | Level 26

I said to use the SCORE statement in PROC PLM. You didn't do that.

 

I used the below syntax and added the "store out=saved.PLMdata;". My initial expectation was that this would save a "PLMdata" in my "saved" file. However, I couldn't find such a file and only found a "Logfit" file in the "Work" library (screen shots attached of the icon and the data itself. Would it be safe to assume that "PLMdata" and the "Logfit" files are the same things and I can export the Logfit file? Thank you so much in advance for your response!

 

Your PROC GLM code creates saved.PLMdata and then later a your PROC PLM code creates Logfit, these are not the same. In addition, saved.PLMdata is not a SAS data set, it is what SAS calls an "item-store".

--
Paige Miller
Heejeong
Obsidian | Level 7

Thank you so much, @PaigeMiller, for commenting on the two different codes (Score statement & Logfit). I had a few follow-up questions:

1) I didn't include the SCORE statement in PROC PLM because from the readings I had done, PROC PLM applies new analysis (e.g., getting predicted values of the data where the glm analysis has already been done, etc.). And I just wanted to save the data that was used to graph and create the Figure. Could you please kindly show me how I can export the data without making additional changes to the existing data? This leads to my second question below.

2) Would it be correct to think that the Logfit data is the data generated from the PROC GLM to graph the results? If so, would the Logfit data be what my co-author would want? Again, she just wanted the data to be able to graph in different ways (just changing the design of the graph. 

 

Thank you so much for all your help and I'm sorry I'm not figuring this out right away!

 

PaigeMiller
Diamond | Level 26

I withdraw my suggestion to use SCORE in PROC PLM.

 

Answer to #2 first ... I don't know, you have to ask your co-author. Also, did you even try to figure out what is in Logfit so as to figure out if it would work as a data set that you could plot from?

 

Answer to #1 ... PROC PLM output which you call Logfit, what is wrong with it? You seem to be implying that you cannot use it for plotting. Why cannot you use it?

--
Paige Miller

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!

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
  • 5 replies
  • 841 views
  • 1 like
  • 2 in conversation