Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when running rk_rake #91

Open
radders opened this issue Oct 4, 2019 · 4 comments
Open

Error when running rk_rake #91

radders opened this issue Oct 4, 2019 · 4 comments
Assignees
Labels

Comments

@radders
Copy link

radders commented Oct 4, 2019

When running the rk_rake command, I'm getting this error :

Error in if (!sum(weights_dec%%1) > 0) { : missing value where TRUE/FALSE needed

The arguments con, inds, vars look correct.

Any idea what could be causing this? First time I've used the package.

Thank

@philmikejones
Copy link
Owner

Are you able to share some of your data so I can replicate the error? Happy to take a look.

@radders
Copy link
Author

radders commented Oct 5, 2019

Thanks for having a look at this. I can't show the individuals data but the structure is :

person_id, sex, oa_code, age_band, age_sex, oac_grp and it has just over 3,000 rows.

I'm using the code from Roger Beecham's tutorial here :
http://homepages.see.leeds.ac.uk/~georjb/predictive-analytics/assignment/01-simulating-behaviour/

The other data attached is from the census.

data.zip

@philmikejones
Copy link
Owner

Hi Rob,

I've just emailed you an answer as well.

I think what was causing the error was that you had a zone that required lots of people of OAC group 3, but only 2 individuals of that group. These also both happened to be male 35-64, so the algorithm had no individuals of other age/sex combinations to simulate.

I've removed these and the simulation works, which I've sent to you. Please leave this issue open as I want to incorporate a way to test for errors of this type to provide feedback to the user. I'll have to come back to this, though.

@philmikejones philmikejones self-assigned this Oct 14, 2019
@philmikejones
Copy link
Owner

Technical note: NA/NaNs introduced at weight stage in rk_weight()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants