[R] about difMH, loop, and output

Yung Chih Ou chihchihou at gmail.com
Tue Dec 11 14:57:41 CET 2012


Dear all:

I have 10 response matrices with missing data.

I used difMH to detect DIF items.

syntax as:
n<-10
difMH<-list()
for (i in 1:10){
  difMH[[i]]<-difMH(respM[[i]], group="group", focal.name=1 , MHstat="MHChisq",
        correct=TRUE, exact=FALSE, alpha=0.05, purify=FALSE,
        nrIter=10, save.output=TRUE)

but the output only contains the last detection result.

maybe I should output the list "difMH"?

I tried:
> lapply(difMH, write, "difMH.txt", append=TRUE)

but, R reveals:
Error in cat(list(...), file, sep, fill, labels, append) :
  argument 1 (type 'list') cannot be handled by 'cat'

please help me.
thanks!



More information about the R-help mailing list