Re: [R] Implementing a linear restriction in lm()

2008-12-25 Thread Daniel Malter
r-h...@stat.math.ethz.ch Betreff: Re: [R] Implementing a linear restriction in lm() Hi, You could use the "offset" argument in lm(). Here is an example: set.seed(123) x <- runif(50) beta <- 1 y <- 2 + beta*x + rnorm(50) model1 <- lm (y ~ x) model2 <- lm (y

Re: [R] Implementing a linear restriction in lm()

2008-12-25 Thread Ravi Varadhan
2008 9:39 pm Subject: [R] Implementing a linear restriction in lm() To: r-h...@stat.math.ethz.ch > > Dear All! > > I want to test a coeffcient restriction beta=1 in a univariate model > lm > (y~x). Entering > lm((y-x)~1) does not help since anova test requires the same d

[R] Implementing a linear restriction in lm()

2008-12-24 Thread Serguei Kaniovski
Dear All! I want to test a coeffcient restriction beta=1 in a univariate model lm (y~x). Entering lm((y-x)~1) does not help since anova test requires the same dependent variable. What is the right way to proceed? Thank you for your help and marry xmas, Serguei Kaniovski