@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?
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;