Re: [R] adding factor scores back to an incomplete dataset...

2009-08-29 Thread Mark Difford
Hi David, Phil, Phil Spector wrote: David - Here's the easiest way I've been able to come up with. Easiest? You are making unnecessary work for yourselves and seem not to understand the purpose of ?naresid (i.e. na.action = na.exclude). Why not take the simple route that I gave, which really

Re: [R] adding factor scores back to an incomplete dataset...

2009-08-28 Thread David G. Tully
Thanks, Prof Spector. Your first solution works well for me. Phil Spector wrote: David - Here's the easiest way I've been able to come up with. I'll provide some sample data to make things clearer (hint, hint): dat = data.frame(matrix(rnorm(100),20,5)) dat[3,4] = NA dat[12,3] = NA scrs =

[R] adding factor scores back to an incomplete dataset...

2009-08-25 Thread David G. Tully
I am sure there is a simple way to do the following, but i haven't been able to find it. I am hoping a merciful soul on R-help could point me in the right direction. I am doing a factor analysis on survey data with missing values. to do this, I run: FA1-factanal(na.omit(DATA), factors = X,

Re: [R] adding factor scores back to an incomplete dataset...

2009-08-25 Thread David Winsemius
On Aug 25, 2009, at 3:45 PM, David G. Tully wrote: I am sure there is a simple way to do the following, but i haven't been able to find it. I am hoping a merciful soul on R-help could point me in the right direction. I am doing a factor analysis on survey data with missing values. to do

Re: [R] adding factor scores back to an incomplete dataset...

2009-08-25 Thread Mark Difford
Hi David, I am doing a factor analysis on survey data with missing values. ... Is there a way to subset from my original data set that will work with factanal() and preserve the original rows or that will allow me to append the factor scores back onto the original dataset with the proper

Re: [R] adding factor scores back to an incomplete dataset...

2009-08-25 Thread Phil Spector
David - Here's the easiest way I've been able to come up with. I'll provide some sample data to make things clearer (hint, hint): dat = data.frame(matrix(rnorm(100),20,5)) dat[3,4] = NA dat[12,3] = NA scrs = factanal(na.omit(dat),factors=2,scores='regression')$scores rownames(scrs) =