Dear all,
Consider the following:
 
library(MASS); data(HairEyeColor)
l1 <- loglm(~ 1+2+3, data=HairEyeColor)
myloglm <- function(){
  nd <- HairEyeColor
  v <- loglm(~ 1+2+3, data=nd)
  return(v)
}  
  
l2 <- myloglm()  
  
Now, step(l1) works, whereas step(l2) does not, the problem being that data nd does 
not exist outside myloglm. I was under the impression that objects from functions like 
glm() and lm() "carried their data" with them, but that does not seem to be the case 
for loglm(). Is there a reason for these different behaviours??
 
Thanks in advance
SÃren HÃjsgaard

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to