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().
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
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")
> >
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
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
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>
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
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
8 matches
Mail list logo