BookmarkSubscribeRSS Feed
SouravRoy
Fluorite | Level 6

 

How could one jointly estimate GLM parameter along with fitting B spline to the parameters of factor levels. I am using PROC HPGENSELECT

3 REPLIES 3
Rick_SAS
SAS Super FREQ

You can use PROC GLMSELECT for these tasks.  I'm not sure what you mean by "jointly estimate." You cannot simultaneously estimate two different models; you would need to run a procedure twice. However, maybe you meant "main effects plus spline terms." If so, that is easily done.

 

To fit the GLM model, use the usual syntax. If yu don't want variable selection, use the SELECTION=NONE option on the MODEL statement.

 

To fit the B splines, use the EFFECT statement and the SPLINE option with BASIS=BSPLINE. An example is available in the article "Regression with restricted cubic splines in SAS". The article uses a different spline basis, but contains the main ideas.  

 

If you have questions, I suggest you post them using the example data in the blog post.

SouravRoy
Fluorite | Level 6

Thanks for your reply, the idea behind joint estimation of spline was to smooth the parameter and also carry-over the impact to estimation of other parameters.

Is it possible to mannually select the position of knots and the shape of curve or would I have to leave it to SAS to give the best fit. What if I wanted to give my own relationship derived from elsewhere. 

 

 

 

Rick_SAS
SAS Super FREQ

Yes, the blog post (and documentation) shows how to set the location of the knots. Yes, you can generate the spline basis functions (also in the article!) and then score the model using coefficients that you specify. You can use PROC SCORE or the DATA step to score the model.

 

I do not know what you mean by "smooth the parameter and also carry-over the impact to estimation of other parameters."  I suggest you read the article, play with the procedure, and then post data, code, and desired output.  

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 3 replies
  • 2267 views
  • 0 likes
  • 2 in conversation