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;
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.
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!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.