04-24-2017 05:47 AM
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.
04-24-2017 06:08 AM
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.
04-24-2017 06:22 AM
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.