Hi Dear users,
for an interactive use, i am trying to write a loop that looks for all
variables in the conditions which i introduced, this is what I'm trying:

library(MASS)> i=1> for (i in 58:1){+ for(j in 58:i){+ + str.temp <-
paste("y1 ~ x", i, "* x", j, sep = "")+
univar<-glm.nb(as.formula(str.temp), data=df)+
b=summary(univar)$coeffients[4,4]+ b<-c(i,j)+ if(b < 0.6){ +
print(b)+    }+   }+   }

i have no error but i didn't get true response too, my result is this:


b[1] 1 1

 but i want all the variables that their p-value are less than 0.6, i
think i couldn't write a true loop,can you help me?

thank you in advance for any help

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to