☑ This topic is solved.
Need further help from the community? Please
sign in and ask a new question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Actually, it is more likely that would result from the data not being in proper sorted order. Be sure that the values in the DATA= data set are sorted in increasing order of the X axis variable (cPAreactpost).
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thank you so much!
So I tried the code below to proc sort the data by the predictor but got the following error message:
I also tried deleting the values statement but it didn't change the figure shape. Thank you so much for troubleshooting this with me!
proc means data=JH.Final3;
var cPAreactpost;
output out=out mean=mean std=sd;
run;
data mdat;
set out;
keep cPAreactpost;
do cPAreactpost = mean-sd, mean, mean+sd;
output;
end;
run;
%Margins(data=JH.Final3, response=B4BNOCRE, model=cage ClinicSex marriedmidus work race_orig cedu cHHtotalIncome EverSmokeReg Exercise20mins CNSmeds cBMI cCESD cNeuroticism cChronCondNumb cAnyStressWide_sum cpa_mlm2 cPAreactpost,
margins=cPAreactpost, margindata=mdat,
options=diff reverse cl)
proc sort data=_margins;
by cPAreactpost;
run;
proc sgplot data=_margins noautolegend;
band upper=UPPER lower=LOWER x=cPAreactpost ;*/ transparency=.3;
series y=ESTIMATE x=cPAreactpost;
xaxis values=(-0.0627 0 0.0627) grid offsetmin=.05 offsetmax=.05
label="Positive Affective Responsivity";
yaxis values=(10 to 40 by 5) grid offsetmin=.05 offsetmax=.05
label="Norepinephrine";
title "Effects of Positive Affective Responsivity on Norepinephrine";
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Perhaps you have the _MARGINS data set open in a ViewTable window. If not, try adding an OUT= option in your PROC SORT step (proc sort data=_margins out=mymargins; ...) and then using the MYMARGINS data in PROC SGPLOT. If none of that works, close and restart SAS and rerun all of it (with the OUT= in PROC SORT).
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I closed everything and reran the syntax with the "with the OUT= in PROC SORT" and it worked! I can't be more thankful for all your help today! I learned so much and feel so much more confident with my analyses. Thank you so much, @StatDave , for your helpful and fast responses even at night time! I really appreciate it.
- « Previous
-
- 1
- 2
- Next »