Displaying 3 results from an estimated 3 matches for "dum2".
Did you mean:
dom2
2010 Dec 16
1
predict.lm with new regressor names
...has been run and we have the lm object. And we have a
dataframe that has columns that don't correspond by name to the
original regressors. I very! naively assumed that doing this (below)
would work. It does not.
# does not work
lm.yx$coefficients<-c("Intercept", "n.x1")
dum2<-data.frame(Int=rep(1,200), n.x1=rnorm(200))
predict(lm.yx, newdata=dum2)
I know that a simple alternative is to do:
# because we messed around with the lm object above, re-building
lm.yx<-lm(y~x1)
# change names of dum2 to match names of coefficients of lm.yx
names(dum2)<-names(coeffic...
2010 Mar 04
4
Analogue to SPSS regression commands ENTER and REMOVE in R?
I am not sure if this question has been asked before - but is there a
procedure in R (in lm or glm?) that is equivalent to ENTER and REMOVE
regression commands in SPSS?
Thanks a lot!
--
Dimitri Liakhovitski
Ninah.com
Dimitri.Liakhovitski at ninah.com
2002 Aug 30
4
Intercept in model formulae.
Hi,
I'm trying to create a linear model for a dataset that has a breakpoint e.g.
# dummy dataset
x <- 1:20
y <- c(1:10,seq(10.5,15,0.5))
plot(x,y)
I've modelled this using the following formula:
temp <- lm(y ~ x*(x<=10)+x*(x>10))
I want to be able to omit the intercept (i.e. force the line through
zero) from the first of these segments (x<=10) so that I'm only