Programming the statistical procedures from SAS

How to specify "naturalcubic" in effect command in quantreg procedure

Reply
N/A
Posts: 1

How to specify "naturalcubic" in effect command in quantreg procedure

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;

run;

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?

Thank you.

SAS Super FREQ
Posts: 3,317

How to specify "naturalcubic" in effect command in quantreg procedure

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

Ask a Question
Discussion stats
  • 1 reply
  • 170 views
  • 0 likes
  • 2 in conversation