Rick: Thank you for the link and suggestions. I have been doing a logistic regression with only one continuous variable being a spline. The Univariate code is as follows: ods select ModelANOVA ParameterEstimates SplineKnots;
proc logistic data=HEERDT.VPICU_label;
effect spl = spline(Ind_DBP1 / details naturalcubic basis=tpf(noint)
knotmethod=percentiles(5) ); /* fit model by using spline effects */
model Vent__240(reference ='0')= spl / ct covb clodds=wald selection=none;
output out=SplineOut predicted=Fit lower = l upper = u; /* output predicted values for graphing */
effectplot fit;
run;
proc sort data =SplineOut; by Ind_DBP1; run;
proc sgplot data = SplineOut;
band x=Ind_DBP1 lower=L upper=U;
series x = Ind_DBP1 y = fit/ curvelabel = "Predicted value";
series x = Ind_DBP1 y = u/ curvelabel = "Upper CI";
series x = Ind_DBP1 y = l/ curvelabel = "Lower CI";
run; I tried some of your suggestions, but since you were using gym, and only had single lines rather than 95% CI's as well, I got a bit confused and was not able to get it to work. Initially I just added multiple covariates, ands this worked fine when running loess in proc sgplot, but with series there were alot of jagged lines for all the reasoned you had mentioned. I tried various iterations of slice fit: ods select ModelANOVA ParameterEstimates SplineKnots;
proc logistic data=HEERDT.VPICU_label;
effect spl = spline(Ind_DBP1 / details naturalcubic basis=tpf(noint)
knotmethod=percentiles(5) ); /* fit model by using spline effects */
class Sex(ref="F")Race_d (ref="C")/param=ref;
model Vent__240(reference ='0')= spl Sex Age
/* Race_d CABG ACEI ARB Statin1 BMI NIDDM1 BB pre_Cr pre_K*/
/ ct covb clodds=wald selection=none;
output out=Splineout predicted=Fit lower = l upper = u; /* output predicted values for graphing */
effectplot slicefit / at (Sex ='F' Age=50);
run;
proc sort data =SplineOut; by Ind_DBP1; run;
proc sgplot data = SplineOut ;
band x=Ind_DBP1 lower=L upper=U;
series x = Ind_DBP1 y = fit/ curvelabel = "Predicted value";
series x = Ind_DBP1 y = u/ curvelabel = "Upper CI";
series x = Ind_DBP1 y = l/ curvelabel = "Lower CI";
run; The only difference I see between your examples and what I am modeling is that you had a continuous dependent variable and that I was generating predicted probabilities out of a logistic regression. And that I was plotting confidence intervals, Adding anything my univariate model created jagged edges because this was being modeled on the actual values I guess rather than an an estimate of what these should be by the model. If this was not entertaining enough, I am also trying to get a way to get odds ratios for pr-specifiued levels of the continuous exposure that is splined, comparing the odds of that level to the mode. It seems to be easy in Stada and R but not SAS. Any idea ?
... View more