hello, We've got a problem with the mix package in order to impute the missing data. After importing the data, the prelim function does not work (only the stlouis data works). We have done :>library(mix) >Manq <- read.table("C:/.../file.txt") >attach(Manq) >save(Manq,file="C:/../R/rw2001/library/mix/data/Manq.rda") >data(Manq) >ManqV1 V2 V3 V4 1 1 1 1 1 2 1 1 3 6 3 1 2 6 2 ... ... 52 2 7 6 2>Essaimanq <-prelim.mix(Manq,4)Error in as.integer.default(list(V1 = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1,: (list) object cannot be coerced to integer thank you
Hi, i guess that prelim.mix needs a matrix rather than a data frame. best jan On Fri, 11 Feb 2005, Stephanie.Tomczak at eleves.polytech-lille.fr wrote:> hello, > > We've got a problem with the mix package in order to impute the missing data. > After importing the data, the prelim function does not work (only the stlouis > data works). > > We have done : > > >library(mix) > >Manq <- read.table("C:/.../file.txt") > >attach(Manq) > >save(Manq,file="C:/../R/rw2001/library/mix/data/Manq.rda") > >data(Manq) > >Manq > V1 V2 V3 V4 > 1 1 1 1 1 > 2 1 1 3 6 > 3 1 2 6 2 > ... > ... > 52 2 7 6 2 > > >Essaimanq <-prelim.mix(Manq,4) > Error in as.integer.default(list(V1 = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1,: > (list) object cannot be coerced to integer > > thank you > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html-- +----------------------------------------- Jan Goebel j g o e b e l @ d i w . d e DIW Berlin German Socio-Economic Panel Study (GSOEP) K?nigin-Luise-Str. 5 D-14195 Berlin -- Germany -- phone: 49 30 89789-377 +-----------------------------------------
See ?prelim.mix which says x: data matrix containing missing values. The rows of x and you gave a data *frame*. It is not prelim.mix that `does not work'. On Fri, 11 Feb 2005 Stephanie.Tomczak at eleves.polytech-lille.fr wrote:> hello, > > We've got a problem with the mix package in order to impute the missing data. > After importing the data, the prelim function does not work (only the stlouis > data works). > > We have done : > >> library(mix) >> Manq <- read.table("C:/.../file.txt") >> attach(Manq) >> save(Manq,file="C:/../R/rw2001/library/mix/data/Manq.rda") >> data(Manq)Don't do this -- it's a package, not a play area.>> Manq > V1 V2 V3 V4 > 1 1 1 1 1 > 2 1 1 3 6 > 3 1 2 6 2 > ... > ... > 52 2 7 6 2 > >> Essaimanq <-prelim.mix(Manq,4) > Error in as.integer.default(list(V1 = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1,: > (list) object cannot be coerced to integer > > thank you-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595