Re: [R] adding predictor to linear model without changing existing coefficients

2017-05-17 Thread Bert Gunter
You should consult a linear models text, but, assuming I have correctly understood your post, the procedure is this (the translation to R code is trivial, and I leave it to you): Let y be the response variable, P1 be the first set of predictors and z be your new predictor to be added. 1. regress

Re: [R] adding predictor to linear model without changing existing coefficients

2017-05-17 Thread Viechtbauer Wolfgang (SP)
.com >-Original Message- >From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Urs >Kleinholdermann >Sent: Wednesday, May 17, 2017 09:12 >To: r-help@r-project.org >Subject: [R] adding predictor to linear model without changing existing >coefficients > >D

[R] adding predictor to linear model without changing existing coefficients

2017-05-17 Thread Urs Kleinholdermann
Dear list members, I want to add a predictor to a linear model without changing the coefficients of the existing model. How is that done with R? So if I have a response y and predictors x1, x2, x3 I want to make a model lm1 like lm1 = lm(y~x1+x2) After this model is computed I want to add x3 l