BookmarkSubscribeRSS Feed
jina1
Calcite | Level 5

@Rick_SAS @StatDave_sas

 

[restricted cubic splines in SAS]

Thank you so much for answering my questions quickly.  

I tried  it according to your advice, but I had another question. I want to draw a graph starting with y=1.0 (ORs) like the graph below. If you look at the graph below, it starts at (x:0.3, y:1.0). How can I draw it like the graph below?

 

 

 

 

 

 

sample .jpg

proc logistic data=hn14_18_total;

effect spl=spline(n_3kcal / details naturalcubic basis=tpf(noint)

knotmethod=percentiles(5));

model mh_PHQ_S10(event='1') = spl / selection=none alpha=0.3 ;

units n_3kcal=0.3;

oddsratio n_3kcal / at (n_3kcal=0.0163166 to 4.98120 by 0.3) cl =pl;

ods output ORplot=orp;

quit;

 

data orpgraph; set orp;

n_3kcal=input (scan (displaylabel, 0.3, "=" ), best. );

label n_3kcal="n_3kcal";

run;

 

proc sgplot data=orpgrap noautolegend;

band x=n_3kcal  upper=upperCLdispl;ay lower=lowerCLdisplay;

series x=n_3kcal y=addsRatioEstDisplay;

yaxis label="odds Ratio";

run;

 

 

 

1 REPLY 1
ChrisNZ
Tourmaline | Level 20

Re-titled and moved to the procedures forum.

SAS Innovate 2025: Register Today!

 

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 683 views
  • 0 likes
  • 2 in conversation