kosukeimai / wru

Who Are You? Bayesian Prediction of Racial Category Using Surname and Geolocation
129 stars 30 forks source link

Error: Models using age and sex not currently implemented #91

Closed 31YY88 closed 1 year ago

31YY88 commented 1 year ago

Hi,

I'm working on a paper and one of the reviewers suggested that I'll use your package to get more accurate race probabilities. My data includes gender variable, but every time I use predict_race with it I get the following error: "Error in census_helper_new(key = census.key, voter.file = voter.file, : Models using age and sex not currently implemented."

I also tried to run the examples from the README.md file and the same error occurs. See picture below.

image

Would love to learn if there is a systematic problem or just something on my end. Thank you so much for this package!!!

1beb commented 1 year ago

The error message says it all here. The package doesn't have age and sex implemented yet for the new census data. It's on the todo list!

31YY88 commented 1 year ago

Thank you so much! Is it available for the 2010 census?

1beb commented 1 year ago

Yes, you would need to download an earlier version of the package. For example:

remotes::install_github("kosukeimai/wru@0.1-12")

Note that this would install an older version of the software, if you wanted to use 2020 again, you would need to reinstall without the @0.1-12.

31YY88 commented 1 year ago

Thank you, this works! Is there an option to use the first name as part of the Bayesian predication?

1beb commented 1 year ago

I don't recall for 0.1-12, you would have to check ?predict_race. (I have the most recent installed right now so can't check)