Data Imputation (rms) aregImpute

1,225 views
Skip to first unread message

steve

unread,
Oct 5, 2012, 1:06:58 PM10/5/12
to meds...@googlegroups.com

  Hi All,
I am trying to impute missing values in my data using aregImpute ,cat1 is a three level factor with no "NA" ,
Brs has about 20% missing but the cat1 with no missing is give me problems.
The error below is what I get when I run it,  can someone tell me what I need to do to make it work

xtrans <- aregImpute(~cat1+Age+var1+cat2+var3+Brs,n.impute=100,nk=4, ,match="closest",pl=F ,data=data3,x=T)

Error in aregImpute(~cat1 + Age + Case.Duration.min + Pt.Gender + ASA +  :
  a bootstrap resample had too few unique values of the following variables:
cat1

Thanks
Stevo
...................................................................

steve

unread,
Oct 5, 2012, 1:15:00 PM10/5/12
to meds...@googlegroups.com
Should Have Read

On Friday, October 5, 2012 12:06:58 PM UTC-5, steve wrote:

  Hi All,
I am trying to impute missing values in my data using aregImpute ,cat1 is a three level factor with no "NA" ,
Brs has about 20% missing but the cat1 with no missing is give me problems.
The error below is what I get when I run it,  can someone tell me what I need to do to make it work

xtrans <- aregImpute(~cat1+Age+var1+cat2+var3+Brs,n.impute=100,nk=4, ,match="closest",pl=F ,data=data3,x=T)

Error in aregImpute(~cat1 + Age + var1+ cat2 + var3+Brs+  :

Steve Simon, P.Mean Consulting

unread,
Oct 5, 2012, 3:21:07 PM10/5/12
to meds...@googlegroups.com, steve
On 10/5/2012 12:06 PM, steve wrote:

> I am trying to impute missing values in my data using aregImpute
> ,cat1 is a three level factor with no "NA" , Brs has about 20%
> missing but the cat1 with no missing is give me problems. The error
> below is what I get when I run it, can someone tell me what I need
> to do to make it work
>
> xtrans <- aregImpute(~cat1+Age+var1+cat2+var3+Brs,n.impute=100,nk=4,
> ,match="closest",pl=F ,data=data3,x=T)
>
> Error in aregImpute(~cat1 + Age + Case.Duration.min + Pt.Gender + ASA
> + : a bootstrap resample had too few unique values of the following
> variables: cat1

So what happens when you drop cat1 from the model? I'm just guessing,
but perhaps there is some confusion about whether cat1 is a continuous
variable or not. You may need to convert it to a factor first and then
run the analysis.

By the way, everything I've read suggests that 5 or 10 is the number of
imputed variables you need. Any reason why you are asking for 100
imputed samples?

Steve Simon, n...@pmean.com, Standard Disclaimer.
Sign up for the Monthly Mean, the newsletter that
dares to call itself average at www.pmean.com/news

steve

unread,
Oct 5, 2012, 3:47:47 PM10/5/12
to meds...@googlegroups.com, steve

If I drop cat1 it works fine ..and perfect i originally did a 7 , i still had those problems. Thanks for your quick response.
 

Wasteva

unread,
Oct 5, 2012, 7:42:15 PM10/5/12
to meds...@googlegroups.com, steve

If I drop cat1 it works fine ..and perfect i originally did a 7 , i still had those problems. Thanks for your quick response. I did change cat1 to a factor and is still given that error.
Wasteva IL
 

Frank Harrell

unread,
Oct 6, 2012, 11:16:48 PM10/6/12
to meds...@googlegroups.com, steve
Often 5 or 10 isn't enough.  Recent research suggests 1 imputation for every percent of records containing a missing variable.

If using boot.method='simple' you can use the group= argument to aregImpute to do a balanced bootstrap for cat1.  That's better than removing the variable

Frank


On Friday, October 5, 2012 2:21:15 PM UTC-5, Steve Simon wrote:

Wasteva

unread,
Oct 23, 2012, 6:01:08 PM10/23/12
to meds...@googlegroups.com, steve

Thanks very much Frank , that was helpful.
 
Reply all
Reply to author
Forward
0 new messages