Hello,

I am getting some unexpected results when using mle.stepwise:


# BEGIN

require(wle)
x1 = runif(100)
x2 = runif(100)
y = 3 + 2*x1 + rnorm(100)       

# so x1 is in the model, but not x2

mle.stepwise(y ~ x1 + x2, type = "Backward")          

# Backward selection gets it right, the other two return non-sense

mle.stepwise(y ~ x1 + x2)       
mle.stepwise(y ~ x1 + x2, type = "Stepwise")

# If the variables are entered in a different order, the result changes

mle.stepwise(y ~ x2 + x1)
mle.stepwise(y ~ x2 + x1, type = "Stepwise")

# END


I am running R version 2.6.0 Patched (2007-11-09 r43408) on Mac OS X 10.4.11 and the latest version of wle 0.9-3.

Any idea? Help much appreciated. I will introduce these functions in my applied statistics class on Monday!

Thanks,
Ery

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to