[R] store result of loop in df

2016-07-29 Thread Alain D. via R-help
Dear list, I have a dataframe df: df<-data.frame(x=c(5,32,18,3,17), n=c(11,200,432,20,60)) Now I want to run n=nrow binom.test() with x being the number of success and n the number of trials and then store the results as a new VAR in df. I tried for (i in 1:nrow(df)){ df$VAR<-(binom.test

[R] function to carry out Bootstrap LRT with poLCA results

2016-03-31 Thread Alain D. via R-help
Dear List, I would like to determine the optimal number of latent classes (polytomous data) using Bootstrap LRT. poLCA does not provide such a possibility and I am not enough into programming to modify the code. Is there any other way to do this, e.g. use a poLCA object with some other package?