Skip to content

Unavoidable "Some initial race values are NA." error #163

@kaseyzapatka

Description

@kaseyzapatka

Hey and thanks so much for creating such a wonderful package!

I've done all the checks but am still getting the following the following error. I'm using model = "fBISG" and I've set impute.missing = TRUE, and skip_bad_geos = TRUE. I think the issue stems from that there are 47 more tracts in the dataset I pulled from the US Census using wru' s get_census_data function than in the dataset from which I'm trying to impute race. I would think setting the two aforementioned parameters would solve this but the error only works when I set model = "BISG". Perhaps, I could drop those 47 extra tracts? But I'm having trouble filtering the wru census data since it's a nested list. When I

Error in `predict_race()`:
! Some initial race values are NA.

         If you didn't provide initial values, check the results of calling predict_race() on the voter.file you want me to work on.

         The most likely reason for getting a missing race prediction is having a geolocation that does not match 
 
         locations on the census. If this problem persists, try impute.missing = TRUE or model = fBISG.
Hide Traceback
    ▆
 1. └─wru::predict_race(...)

Unfortunately, I wanted to use the fBISG function. do you have any thoughts on why this might be? (I can't produce a reproducible examples given the data are proprietary). Here is the code I'm running so you can see.

df_predicted_wru <-
  predict_race(
    voter.file = df_processed,
    census.geo = "tract",
    year = "2020",
    model = "fBISG",
    census.data = census_data_wru,
    age = FALSE,
    sex = FALSE,
    impute.missing = TRUE,
    skip_bad_geos = TRUE
  )

Any thoughts or help would be appreciated. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions