Thank you for your reply Matt.

I figured out what was wrong by running sapply(dataSet, var, na.rm=TRUE), as you suggested.

When I ran that command, R returned "NaN" for the variable with which I was having problems. After a bit of investigation, it seems that the function I used to construct the variable had, for 3(!) of my 7500 or so observations, divided by zero. That seems to be the reason for the error. I recoded the variable differently, and the imputation is working again. I should have more carefully thought through how it was coded.

Thanks again,
Gregory



On Thu, Sep 30, 2010 at 4:52 PM, Matt Blackwell <blackwel@fas.harvard.edu> wrote:
Hi Gregory,

Are there other variables in your imputation model aside from any that
you are setting to "cs" or "id"? Also, to get a sense for the problem,
can you run "sapply(mydata, var, na.rm=TRUE)" on your data to see what
happens. There should be a number associated with that variable. It
might help track down the problem.

Cheers,
matt.

On Tue, Sep 28, 2010 at 6:48 PM, Gregory Eady <gregory.eady@gmail.com> wrote:
> I added a new real number variable to my dataset, but when I try to impute
> it along with the rest of the dataset, I receive the following error:
> Error in if (sum(non.vary == 0)) { :
>   argument is not interpretable as logical
> It is a real number variable (checked it with is.real()), and it doesn't
> seem to be different from the other real number variables in the dataset.
> I've updated to the newest version of Amelia (Version 1.2-17, built:
> 2010-05-10). I noticed from looking through the mailing list archives that
> this error was present in 1.2-14, and was fixed (by Matt Blackwell) in
> 1.2.-15. It seems to be back. Perhaps this is my fault somehow however. Any
> help would be appreciated.
> Thank you,
> Gregory