search for: retailsmall

Displaying 1 result from an estimated 1 matches for "retailsmall".

2006 Jan 16
1
princomp() with missing values in panel data?
dear R wizards: the good news is that I know how to omit missing observations and run a principal components analysis. p= princomp( na.omit( dataset ) ) p$scores[ ,1] # the first factor (where dataset contains missing values; incidentally, princomp(retailsmall, na.action=na.omit) does not work for me, so I must be doing something wrong, here.) the bad news is that I would like NA observations to be retained as NA, so that I can reinsert the factors into the data set: dataset$first.factor = p$scores[,1] there must be an elegant way of doing this. help...