Skip to content
Prev 76895 / 398503 Next

Tip: I() can designate constants in a regression

David James <djames at frontierassoc.com> writes:
First check whether your claim is actually correct:
+           trace = TRUE)
74.2686 :  0.12345 0.54321
0.0006529895 :  -0.002666984  1.000334031
Nonlinear regression model
  model:  yeps ~ a + b * x
   data:  parent.frame()
           a            b
-0.002666984  1.000334031
 residual sum-of-squares:  0.0006529895
80.31713 :  0.54321
0.0006682311 :  0.999953
Nonlinear regression model
  model:  yeps ~ a + b * x
   data:  parent.frame()
       b
0.999953
 residual sum-of-squares:  0.0006682311

I.e., turning a into a constant works quite happily without the I().