Hey all. I am a very beginner at statistics and SAS program and have difficulties in presenting my study. I would like to make a graph: x=years, y= "adjusted" Odds Ratio (reference": year1 data) and a band of 95%confidence intervals. I read some manuals and blogs but kept failing it. I don't know how to set "years1 data" as my reference, and why my graph is jagged after covariate adjustment. here are my codes and graph. Many thanks. PROC SORT DATA=CM.POSTMP OUT=TEST;
BY WITH6; RUN; /*WITH6 is my independent variable(years)*/
ods select ANOVA ParameterEstimates SplineKnots;
proc LOGISTIC data=TEST;
effect spl = spline(WITH6/ NATURALCUBIC details basis=tpf(noint) );
CLASS EDU_GR(REF='1') MARRIAGE_GR(REF='1') WORK_GR(REF='0') INCOME_Q(REF='1') SMOKE_GR(REF='0') ALCOHOL_GR(REF='0') MET_GP(REF='1') B12(REF='1') /PARAM=REF;
model HTN_SYS(EVENT="1")= spl AGE EDU_GR MARRIAGE_GR WORK_GR INCOME_Q SMOKE_GR ALCOHOL_GR MET_GP BMI B12 / selection=none; /*HTN_sys is binary*/
output out=SplineOut predicted=Fit;
quit;
title "Restricted Cubic Spline Regression";
proc sgplot data=SplineOut noautolegend;
scatter x=WITH6 y=HTN_SYS;
series x=WITH6 y=Fit / lineattrs=(thickness=2 color=red);
run;
... View more