Lets say I am regressing Y on X1 and X2, where X1 is a numeric variable and X2 is a factor with four levels (A:D). Is there any way to write the linear regression function lm(Y ~ X1 + as.factor(X2)) so that I can choose a particular level of X2 -- say, B -- as the baseline?
Tell me more
×
Cross Validated is a question and answer site for
statisticians, data analysts, data miners and data visualization experts. It's 100% free, no registration required.
|
|
||||
|
|
|
You can use
|
|||
|
|