[R] Bootstrap 95% confidence intervals for splines

mitchell wachtel Mitchell.Wachtel at ttuhsc.edu
Sun Mar 27 06:05:58 CEST 2011


There appear to be reports in the literature that transform continuous
independent variablea by the use of splines, e.g.,  assume the dependent
variable is hot dogs eaten per week (HD) and the independent variable is
waistline (WL), a normal linear regression model would be:

nonconfusing_regression  <- lm(HD ~ WL)

One might use a spline,

confusion_inducing_regression_with_spline <- lm(HD ~ ns(WL, df = 4) )

Now is where the problem starts. 

>From nonconfusing_regression , I get, say 2 added hot dogs per week for each
centimeter of waistline along with a s.e. of 0.5 hot dogs per week, which I
multiply by 1.96 to garner each side of the 95% c.i.
If I want to show what the difference between the 75th percentile (say 100
cm) and 25th percentile (say 80 cm) waistlines are, I multiply 2 by
100-80=20 and get 40 hot dogs per week as the point estimate with a similar
bumping of the s.e. to 10 hot dogs per week.

What do I do to get the point estimate and 95% confidence interval for the
difference between 100 cm persons and 80 cm persons with
confusion_inducing_regression_with_spline ?

Best regards.

Mitchell S. Wachtel, MD
 
       









--
View this message in context: http://r.789695.n4.nabble.com/Bootstrap-95-confidence-intervals-for-splines-tp3408813p3408813.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list