I'm trying to do a regression
When I execute this code:
olsreg <- lm(Y ~ as.matrix(X))
I get this error message
Error in `[[<-.data.frame`(`*tmp*`, i, value = c(2L, 3L, 3L, 3L, 3L, 3L, : replacement has 1316371 rows, data has 188053
The X matrix has values from seven 7 variables. Seven is precisely 1316371 / 188053 = 7
Can you help me solving this error?