[R] Difficulty replacing NAs using Hmisc aregImpute and Impute
Greg Blevins
gblevins at mn.rr.com
Fri Jul 25 13:28:20 CEST 2003
Hello R experts
I am using Hmisc aregImpute and Impute (following example on page 105 of The
Hmisc and Design Libraries).
*My end goal is to have NAs physically replaced in my dataframe. I have
read the help pages and example in above sited pdf file, but to no avail.
Here is example of what I did.
Ph, my data frame, is attached.
> xt <- aregImpute (~ q5 + q22rev02 + q28a, n.impute=10, x=T, data=Ph)
Iteration:1 2 3 4 5 6 7 8 9 10 11 12 13
> impute(xt)
Multiple Imputation using Bootstrap and PMM
aregImpute(formula = ~q5 + q22rev02 + q28a, data = Ph, n.impute = 10,
x = T)
Method: ace n= 406 p= 3 Imputations: 10
Number of NAs:
q5 q22rev02 q28a
0 88 51
R-squares for Predicting Non-Missing Values for Each Variable
Using Last Imputations of Predictors
q22rev02 q28a
0.348 0.170
> mean(q28a)
[1] NA
The q28a that the system is looking at still has NAs.
Much appreciate any help!
Greg Blevins
The Market Solutions Group, Inc.
More information about the R-help
mailing list