Hi there,
I'm pretty new to STATA, and I was just introduced to Restricted Cubic Splines. Our instructor told us to use the "RCspline" command (she uses SAS, and hasn't been very helpful). I'm trying to predict total hospital costs (logtotcst) based on a few linear variables and a few variables that I need a spline for (one of which is meanbp).
This was the example that I was given:

I'm very new to splines, but the spline I created doesn't look anything like the one above.
The code that I used is:
twoway lfitci logtotcst meanbp || mspline logtotcst meanbp
Spline_meanbp_logtotcst.pdf
Any help would be greatly appreciated!!
I'm pretty new to STATA, and I was just introduced to Restricted Cubic Splines. Our instructor told us to use the "RCspline" command (she uses SAS, and hasn't been very helpful). I'm trying to predict total hospital costs (logtotcst) based on a few linear variables and a few variables that I need a spline for (one of which is meanbp).
This was the example that I was given:
I'm very new to splines, but the spline I created doesn't look anything like the one above.
The code that I used is:
twoway lfitci logtotcst meanbp || mspline logtotcst meanbp
Spline_meanbp_logtotcst.pdf
Any help would be greatly appreciated!!
Comment