search for: esamp

Displaying 1 result from an estimated 1 matches for "esamp".

Did you mean: samp
2011 Jul 11
2
lm: mark sample used in estimation
...example. But I am ideally looking for a way that allows one to use any formula in lm, and still be able to mark the estimation sample. Function/option I am missing? The best I could come up with: > lm.D9 <- lm(weight ~ group, model=TRUE) > ind <- as.numeric(row.names(lm.D9$model)) > esamp <- rep(0,length(group)) #substitute nrow(data.frame used in estimation) for length(group) > esamp[ind] <- 1 > esamp [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 Is this "safe" (recommended?)? Appreciate any help. Best, A