BookmarkSubscribeRSS Feed
emmie
Calcite | Level 5

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.

1 REPLY 1
Rick_SAS
SAS Super FREQ

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

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1338 views
  • 0 likes
  • 2 in conversation