[R] lmrob gives NA coefficients
Christien Kerbert
christienkerbert at gmail.com
Sun Mar 4 00:04:32 CET 2018
Dear list members,
I want to perform an MM-regression. This seems an easy task using the
function lmrob(), however, this function provides me with NA coefficients.
My data generating process is as follows:
rho <- 0.15 # low interdependency
Sigma <- matrix(rho, d, d); diag(Sigma) <- 1
x.clean <- mvrnorm(n, rep(0,d), Sigma)
beta <- c(1.0, 2.0, 3.0, 4.0)
error <- rnorm(n = n, mean = 0, sd = 1)
y <- as.data.frame(beta[1]*rep(1, n) + beta[2]*x.clean[,1] +
beta[3]*x.clean[,2] + beta[4]*x.clean[,3] + error)
xy.clean <- cbind(x.clean, y)
colnames(xy.clean) <- c("x1", "x2", "x3", "y")
Then, I pass the following formula to lmrob: f <- y ~ x1 + x2 + x3
Finally, I run lmrob: lmrob(f, data = data, cov = ".vcov.w")
and this results in NA coefficients.
It would be great if anyone can help me out. Thanks in advance.
Regards,
Christien
[[alternative HTML version deleted]]
More information about the R-help
mailing list