Matt--

Many thanks...
The problem was indeed exactly as you said...

(The program I'm working with deletes all IVs that have only NAs...
But a later step created some more-- which I then tried to pass to Amelia...)

Anyway, I modified my program, and Amelia now accepts my data with no complaint...

Thanks again!...

Wayne

-----Original Message-----
From: Matt Blackwell [mailto:mblackwell@iq.harvard.edu]
Sent: Thursday, August 27, 2009 11:37
To: Wayne Thornton
Cc: amelia@lists.gking.harvard.edu
Subject: Re: [amelia] Amelia error message

Hi Wayne,

After taking a look at your data, it looks like you have about 50 or
so variables that don't vary all marked as "nominals." You'll have to
put those variables into the idvars argument to keep them out of the
imputations.

Here is the code I used to find the problematic variables, along with
their column numbers, for your reference.


> jj <- list()
> for (i in 1:ncol(DATA8i)) jj[i] <- length(unique(na.omit(DATA8i[,i])))
> jj <- unlist(jj)
> which(jj==1)
 [1]  44  46  47  48  49  52  53  54  55  56  61  62 105 141 146 148 151 165 172
[20] 174 179 239 244 245 246 247 248 249 250 251 253 254 257 259 260 269 270 271
[39] 275 278 283 285 287 288 289 290 302 303 304 309

One more thing you should consider is that you will probably not be
able to impute 600+ variables with only 1000 observations. Remember
that if p is the number of variables, then Amelia has to estimate
roughly p^2/2 parameters.

I hope this helps,
matt.

On Wed, Aug 26, 2009 at 12:09 AM, Wayne
Thornton<thornton@fas.harvard.edu> wrote:
> Matt---
>
>
>
> I'm getting an error message I haven't seen before...
>
>
>
>             "Error in newx[, j - 1] <- ifelse(x[, i] == values[j], 1, 0) :
>
>             subscript out of bounds"
>
>
>
> -------------------------------------------
>
> My settings are as follows:
>
>
>
> impruns            <-  5
>
> tolerX               <-  1.0E-4
>
> autopriX            <-  0.05
>
> empriX              <-  round( 0.005* colDATA8* rowDATA8, digits= 0)
>
>
>
>    imputed <- amelia(DATA8i,
>
>                      m  = impruns   ,  p2s = 2     ,
> idvars = c(3,4,5)   ,
>
>                      ts = 1         ,  cs  = 2  , polytime  = NULL,
>
>                                                    startvals = 0   ,
> tolerance = tolerX  ,
>
>                                                                         noms
> = nomIV8ji     ,
>
>                      ords = ordIV8ji,  incheck = T , collect = F     ,
> outname = "DATA8imp",
>
>                      write.out = T  ,  archive = T ,
> keep.data = T       ,
>
>                      empri = empriX ,
> autopri = autopriX  ,
>
>                      bounds = IVlims,                 max.resample =
> resampleX                 )
>
>
>
> The input files are attached.
>
>
>
> -------------------------------------------
>
>
>
> Thanks much for your help…
>
>
>
> Wayne
>
>
>
>
>
> Wayne A. Thornton
>
>
>
> Harvard University
>
> thornton@fas.harvard.edu
>
>