10-17-2011 08:27 PM
In SAS EG 4.3, I'd like to run proc quantreg with effect command specified as natural cubic splines, something like
proc quantreg data = one;
effect spl_age = spline(age / naturalcubic knotmethod = list(3 6 9 11 14));
model outcome = spl_age;
I kept on encountering error message telling me error with using "naturalcubic". What is the correct way to use natural cubic splines in effect command? Is this a SAS9.3 new feature? How do we do this if I am in older version SAS?
10-21-2011 10:04 AM
I assume you are typing this into the program window, since I don't think there is a quantile regression task in EG.
The issue is not what version of EG you are using, but the version of SAS. The EFFECT statement was added to QUANTEREG in 9.22.
You have to have correctly specified knots, which depend on the data values (the AGE values in your example). Delete the KNOTMETHOD= option to see if the problem is the specification of knots, or whether the EFFECT statement is invalid.
For earlier versions of SAS, try using the EFFECT statement in PROC GLMSELECT and use the OUTDESIGN= option to output the dummy variables to a data set. For an example, see the top of p. 5 in this paper: http://support.sas.com/resources/papers/proceedings10/329-2010.pdf