[R] Amelia error

Sarah Goslee sarah.goslee at gmail.com
Wed Apr 18 20:32:56 CEST 2012


Hi,

On Wed, Apr 18, 2012 at 2:18 PM, Gaurav Sood <gsood07 at gmail.com> wrote:
> Using: Amelia::amelia
>
> R version: 2.15
> OS: Windows 7 Enterprise
>
> data = National Election Studies (cross-sectional); mostly ordinal
> variables, some nominal
>
> summary(ad04)
>
>   insurance          jobs          services           ss            women
>  Min.   :1.000   Min.   :1.000   Min.   :1.000   Min.   :1.000   Min.   :1.00
>  1st Qu.:2.000   1st Qu.:3.000   1st Qu.:2.000   1st Qu.:1.000   1st Qu.:1.00
>  Median :4.000   Median :4.000   Median :3.000   Median :1.000   Median :1.00
>  Mean   :3.656   Mean   :4.207   Mean   :3.478   Mean   :1.408   Mean   :1.92
>  3rd Qu.:5.000   3rd Qu.:6.000   3rd Qu.:4.000   3rd Qu.:2.000   3rd Qu.:2.00
>  Max.   :7.000   Max.   :7.000   Max.   :7.000   Max.   :3.000   Max.   :7.00
>  NA's   :97      NA's   :105     NA's   :146     NA's   :21      NA's   :52
>
> aout04 <- amelia(ad04,noms=c("race","south","gender","demrep"), m=5)

According to the summary you posted above, the columns of ad04 are
insurance, jobs, services, ss, women.

But you tell amelia() that the nominal variables in your data frame
are race, south, gender, demrem - none of which appear in ad04.

You might want to take a look at the example given in ?amelia and then
if you're still having trouble give us the rest of the information
that I requested, particularly the versions and the reproducible
example, or at the very least the output of str(ad04).

Sarah


> Error in if (sum(non.vary == 0)) { :
>  argument is not interpretable as logical
> In addition: Warning message:
> In FUN(X[[34L]], ...) : NAs introduced by coercion
>
>
> On Wed, Apr 18, 2012 at 1:39 PM, Sarah Goslee <sarah.goslee at gmail.com> wrote:
>> Do you mean the Amelia package? Or a function named Amelia()?
>>
>> What is your OS and version of R and package?
>>
>> What are the commands you are using?
>>
>> What do your data look like?
>>
>> Can you provide a reproducible example?
>>
>> Did you read the posting guide?
>>
>> Your problem doesn't "seem like a bug" rather than user error unless
>> we know a whole lot more about it.
>>
>> Sarah
>>
>> On Wed, Apr 18, 2012 at 1:33 PM, Gaurav Sood <gsood07 at gmail.com> wrote:
>>> Hi,
>>>
>>> Encountering the following error using Amelia -
>>>
>>> Error in if (sum(non.vary == 0)) { :
>>>  argument is not interpretable as logical
>>> In addition: Warning message:
>>> In FUN(X[[34L]], ...) : NAs introduced by coercion
>>>
>>> Seems like a bug.
>>>
>


-- 
Sarah Goslee
http://www.functionaldiversity.org



More information about the R-help mailing list