Re: [R] dealing with missing values

2014-05-20 Thread arun
Also, if the dataset is `dat1`  model.matrix(~X+Y,data=dat1)[,-1]   Xdf Xrd Yas Yeq 1   1   0   1   0 2   1   0   0   0 3   0   0   1   0 4   0   0   0   1 5   0   1   0   0 6   0   1   0   1 A.K. On Tuesday, May 20, 2014 1:32 PM, arun wrote: Hi, It is better to show the data using ?dput(). 

Re: [R] dealing with missing values

2014-05-20 Thread arun
Hi, It is better to show the data using ?dput().  It is not clear whether your missing values are read as "" or NA in the dataset. Also, assuming that the function is from library(ade4) #1st case. NAs dat <-  structure(list(X = structure(c(1L, 1L, NA, NA, 2L, 2L), .Label = c("df", "rd"), class

Re: [R] Dealing with missing values in princomp (package "psych")

2013-03-20 Thread Dimitri Liakhovitski
ect.org [mailto:r-help-boun...@r-project.org] > On Behalf > > Of Dimitri Liakhovitski > > Sent: Wednesday, March 20, 2013 4:17 PM > > To: Bert Gunter > > Cc: r-help > > Subject: Re: [R] Dealing with missing values in princomp (package > "psych") > >

Re: [R] Dealing with missing values in princomp (package "psych")

2013-03-20 Thread William Dunlap
Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf > Of Dimitri Liakhovitski > Sent: Wednesday, March 20, 2013 4:17 PM > To: Bert Gunter > Cc: r-help > Subject: Re: [R] Dealing with missing values in princomp (package "psyc

Re: [R] Dealing with missing values in princomp (package "psych")

2013-03-20 Thread Dimitri Liakhovitski
Yes, Bert, you are right and I do know I might run into a non-positive definite intercorrelation matrix. But if I do, then I can go back to those for whom I am doing the analysis and tell them that. Not before. This sad truth being said - can I do it directly in the function, without building a int

Re: [R] Dealing with missing values in princomp (package "psych")

2013-03-20 Thread Bert Gunter
Well, you can do this, but there's no guarantee that the resulting correlation matrix will be positive definite. And what would principle components based on this mean even if it is positive definite? -- Bert On Wed, Mar 20, 2013 at 3:14 PM, Dimitri Liakhovitski < dimitri.liakhovit...@gmail.com>

Re: [R] Dealing with missing values in princomp (package "psych")

2013-03-20 Thread Dimitri Liakhovitski
Just a small correction. I am running it like this: mypc <- princomp(~.,data=q7a.forfa, cor=TRUE, na.action=na.omit) With na.omit it works. But I have way too many unsystematically missing values on different variables. I tried na.action = na.pass, but it's not working: Error in cov.wt(z) : 'x' mus

[R] Dealing with missing values in princomp (package "psych")

2013-03-20 Thread Dimitri Liakhovitski
Hello! I am running principle components analysis using princomp function in pacakge psych. mypc <- princomp(mydataforpc, cor=TRUE) Question: I'd like to use pairwise deletion of missing cases when correlations are calculated. I.e., I'd like to have a correlation between any 2 variables to be bas

Re: [R] Dealing with missing values in a linear mixed model

2011-07-06 Thread Christine
Hi, within lme(), I think it is only possible to do na.action = na.omit. The default action (= na.fail) causes lme() to print an error message and terminate if there are any incomplete observations Best, Christine - -- Christine Adrion, Dipl.-Stat.,MPH Ludwig-Maximilians-Universität München

[R] Dealing with missing values in a linear mixed model

2011-07-06 Thread Debs Majumdar
Hello,    I am trying to run a linear mixed model using model.a <- lme(Psstotals ~ Visit, data=caf, random= ~ Visit|Id) My dataset looks lie the following:     Id   Visit  Agecorrected Psstotals 1 106 0   19    8 2 106 1   19    9     3