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

non-empirical household variable generation creates households with children living on their own #44

Open
cwhittaker1000 opened this issue Apr 10, 2024 · 5 comments
Labels
bug Something isn't working low priority low priority - consider other things before working on this

Comments

@cwhittaker1000
Copy link
Collaborator

As above, bug fix required

@cwhittaker1000 cwhittaker1000 added the low priority low priority - consider other things before working on this label Apr 10, 2024
@cwhittaker1000
Copy link
Collaborator Author

Low priority as we'll use the empirical approach based on bootstrapping UK households for now.

@cwhittaker1000 cwhittaker1000 added the bug Something isn't working label Apr 10, 2024
@athowes
Copy link
Collaborator

athowes commented Apr 11, 2024

See https://mrc-ide.github.io/helios/articles/helios.html#households for illustration of issue.

@athowes
Copy link
Collaborator

athowes commented Apr 19, 2024

After exposing function can use the following to verify problem:

df <- data.frame(individual_households, age_class_vector)
just_child <- 0
just_child_list <- list()

for(i in individual_households) {
  household <- df[df$individual_households == i, ]
  if(all(household$age_class_vector == "child")) {
    just_child <- just_child + 1
    just_child_list[[i]] <- household$age_class_vector
  }
}

names(just_child_list) <- seq_along(just_child_list)
just_child_list[sapply(just_child_list, is.null)] <- NULL

just_child_list
just_child

I got

> just_child
[1] 381

@athowes
Copy link
Collaborator

athowes commented May 2, 2024

Made some progress on this on the branch just-child-bug but didn't get to a fix

@cwhittaker1000
Copy link
Collaborator Author

@athowes and @tbreweric what do we think about just removing the non-empirical version of this function from the package?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working low priority low priority - consider other things before working on this
Projects
None yet
Development

No branches or pull requests

2 participants