Displaying 2 results from an estimated 2 matches for "lmobj2".
Did you mean:
lmobj
2008 Sep 10
4
re flecting a line
Suppose x and y are numeric vectors of the same length.
plot(x,y) #scatterplot
lmObj1 <- lm(y~x) # best fit line
abline(lmObj1) # good
lmObj2 <- lm(x~y) #get best fit but with axes interchanged
abline(lmObj2) # not what I want. I want the correct line, drawn on the same
graph, but with
# response and predictor variables interchanged
One way to proceed would be to extract the intercept and slope from lmObj2
and the...
2010 Jul 20
1
Transformation of Y changes the 'lm' object?
Hi R,
This is a problem, which I have tried to present in a simple way:
Let,
x1=1:10
x2=2:11
y=2+3*x1
lm_obj=lm(y~x1+x2)
lm_obj
step(lm_obj) # Step function for the first time
y=y^0.1
lm_obj
step(lm_obj) #Step function after a transformation on Y, but 'lm_obj' is not modified.
The two step function behave differently. The first one is before the