Skip to content
Prev 228488 / 398500 Next

How to fix slope and estimate intercept

You can use an offset() term in your formula.  E.g.,
  > x <- log(1:10)
  > y <- 2.7*x + 3.4
  > lm(y ~ 1 + offset(2.7*x))
  
  Call:
  lm(formula = y ~ 1 + offset(2.7 * x))

  Coefficients:
  (Intercept)  
          3.4  

  > lm(y ~ 1 + offset(2.6*x))

  Call:
  lm(formula = y ~ 1 + offset(2.6 * x))

  Coefficients:
     (Intercept)  
  3.551044125731  

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com