[R] mix package causes R to crash
Masanao Yajima
my2167 at columbia.edu
Fri Jul 13 01:47:39 CEST 2007
Dear Professor Schaefer
I am experiencing a technical difficulty with your mix package.
I would appreciate it if you could help me with this problem.
When I run the following code, R 2.5.1 and R 2.6.0 crashes.
It's been tested on at least 2 windows machine and it is consistent.
Execution code it's self was coped from the help file of imp.mix.
Only thing I supplied was a fake dataset.
################################################################
library(mix)
n <-100
x1<-rnorm(n)
x2<-rnorm(n,2,1.2)
x3<-rnorm(n,1,2)
x4<-floor(rnorm(n)*3)
y <-rnorm(n,1*x1+2*x2+3*x3+4*x4,2)
w <-rnorm(n,3,1.2)
ymis<-y
ymis[floor(runif(10,1,n))]<-NA
wmis<-w
wmis[floor(runif(10,1,n))]<-NA
dat<-as.data.frame(cbind(wmis,ymis,x1,x2,x3,x4))
s <- prelim.mix(dat,3) # do preliminary manipulations
thetahat <- em.mix(s) # ML estimate for unrestricted model
rngseed(1234567) # set random number generator seed
newtheta <- da.mix(s,thetahat,steps=100) # data augmentation
ximp <- imp.mix(s, newtheta, dat) # impute under newtheta
################################################################
Your mix package is important part of our ongoing research on the
missing data project and we would like to have it working.
If you could point out to me what I am doing wrong or
some technical difficulty that I am not aware of it will be highly
appreciated.
Thank you for your help in advance.
Sincerely
Masanao Yajima
my2167 at columbia.edu
More information about the R-help
mailing list