Re: [R] princomp() with missing values in panel data?

From: ivo welch <>
Date: Thu 19 Jan 2006 - 00:56:05 EST

thank you. I am still not sure how to get the scores in princomp, though:

ds= cbind(rnorm(10),rnorm(10)) ) names(ds)=c("x1","x2")
pc= princomp( formula = ~ ds$x1 + ds$x2, na.action=na.omit) ds$pc1 = pc$scores[,1] #<-- error, scores has 9 obs, ds has 10 obs

is there an elegant method to do this, or do I need to learn how to operate with pc$loadings? (may I also humbly suggest that the default behavior or $scores should be to contain NA in row 5?)

Incidentally, R is a lot cleverer than I understand. pc$loadings by itself gives me wonderfully intuitive output, with names, text, different components---but I can still use p$loadings[,2]. I presume that the array operator on the "loadings" object is overloaded. very nice.

        [[alternative HTML version deleted]] mailing list PLEASE do read the posting guide! Received on Thu Jan 19 01:29:54 2006

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:42:06 EST