predict.lm() in a loop. warning: prediction from a rank-deficient fit may be misleading
You can inspect the predict function with body(predict.lm). There you will see this line: This warning checks if the rank of your data matrix is at least equal to the number of parameters you want to fit. One way to invoke it is having some collinear covariates: Notice that x3 and x4 have the same direction … Read more