Skip to content

Possible bug in ei_iter() function, failing after adjusting erho parameter #131

@rogers19

Description

@rogers19

Running ei_iter() function and getting the following error:

G20.Marquez ~ Other iteration failed. Retrying with erho = 10 ...

G20.Marquez ~ Other iteration failed. Retrying with erho = 0.5 ...

G20.Marquez ~ Other iteration failed 3 times.
Type ?ei_iter for guidance on how to proceed.
Error on final failure:
Error in solve.default(varcv): 'a' is 0-diml

|======================================================================================== | 75%
G20.Other ~ Other iteration failed. Retrying with erho = 10 ...

G20.Other ~ Other iteration failed. Retrying with erho = 0.5 ...

G20.Other ~ Other iteration failed 3 times.
Type ?ei_iter for guidance on how to proceed.
Error on final failure:
Error in solve.default(varcv): 'a' is 0-diml

Error in { : task 2 failed - ""

I typed ?ei_iter and it guided me to submit an issue here if this problem persists.

To Reproduce
Steps and code to reproduce the behavior:

  1. CSV file with election results data: az_example_data_for_git_issue.csv
  2. R script:
library(eiCompare)

ei_data = read.csv("az_example_data_for_git_issue.csv")
cands = c("G20.Marquez", "G20.Other")
races = c("Native.Alone", "Other")
total = "Total.Votes"

# Standardize vote and race columns to sum to 1
ei_data <- stdize_votes_all(
  data = ei_data,
  cand_cols = cands,
  race_cols = races,
  totals_col = total
)

# Run 2x2 Ecological Inference
ei_2x2 <- ei_iter(
  data = ei_data,
  cand_cols = cands,
  race_cols = races,
  totals_col = total,
  name = "2x2 EI"
)

Expected behavior
I expected ei_iter() to finish running without an error. I'm not seeing any issues in the dataset that would cause that, so I'm. not sure what's going on. I've successfully run this exact code with different election results.

Environment information:

  • eiCompare version: eiCompare_3.0.0
  • Operating system: MacOS Catalina
  • R Environment: R studio, but getting the same error in R command line

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions