[R] prelim.norm() function not working
Inman, Brant A. M.D.
Inman.Brant at mayo.edu
Wed Apr 25 15:00:07 CEST 2007
Thank you very much, that was indeed the problem. (And now that I read
more carefully the help page, it did in fact say that the input was a
data matrix and not a data frame.)
Brant
-----Original Message-----
From: brant.inman+caf_=inman.brant=mayo.edu at gmail.com
[mailto:brant.inman+caf_=inman.brant=mayo.edu at gmail.com] On Behalf Of
Prof Brian Ripley
Sent: Wednesday, April 25, 2007 12:12 AM
To: Brant Inman
Cc: r-help at stat.math.ethz.ch
Subject: Re: [R] prelim.norm() function not working
Looks like you have a data frame where you need a matrix. (The same
issue occurs in most of Joe Schafer's packages, e.g. mix.)
Try as.matrix(usnews).
On Tue, 24 Apr 2007, Brant Inman wrote:
> R-experts:
> I am trying to reproduce some of Paul Allison's results in his little
> green book on missing data (Sage 2002). The dataset for which I am
> having problems, "usnews", can be found at:
> http://www.ats.ucla.edu/stat/books/md/default.htm. I am working on a
> Windows machine with R 2.5 installed, all packages up-to-date.
> The problem has to do with the prelim.norm() function of the package
> "norm". Specifically, I need to use this pre-processing function to
> later use the EM algorithm and DA procedures in the norm package. I
> am getting an error with the following code.
> ----------------------
>> pre <- prelim.norm(usnews)
>
> Error in as.double.default(list(csat = c(972L, 961L, NA, 881L, NA, NA,
:
> (list) object cannot be coerced to 'double'
>
> ---------------------
> I have read the previous postings and I am wondering if the problem
> with prelim.norm is the size of the usnews dataset or the amount of
> missing data.
>
> --------------------
>
>> dim(usnews)
> [1] 1302 7
>
> --------------------
>
>
> Does anyone have any ideas? If not, are there alternatives to norm
> for implementing the MLE and EM methods of dealing with missing data?
>
> Thanks,
>
> Brant Inman
> Mayo Clinic
>
> ______________________________________________
> 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
> and provide commented, minimal, self-contained, reproducible code.
>
--
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
More information about the R-help
mailing list