Skip to content
Prev 23908 / 398503 Next

lm fitting with a specified slope

Assume the model:

  X1 <- rnorm(1000)
  X2 <- rnorm(1000)

  B1 = 1.75 # known a-priorori
  B2 = 0.5  # unknown a-priorori

  Y  <- 1.75 * X1 + 0.5 * X2  + rnorm(1000,sd=0.25)

Then wouldn't this do the trick? :

  reg <- lm( (Y - 1.75 * X1) ~ X2 ) 


-Greg
LEGAL NOTICE
Unless expressly stated otherwise, this message is confidential and may be privileged. It is intended for the addressee(s) only. Access to this E-mail by anyone else is unauthorized. If you are not an addressee, any disclosure or copying of the contents of this E-mail or any action taken (or not taken) in reliance on it is unauthorized and may be unlawful. If you are not an addressee, please inform the sender immediately.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._