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 with using weight variable #35

Open
sfallahpour opened this issue Dec 18, 2023 · 2 comments
Open

error with using weight variable #35

sfallahpour opened this issue Dec 18, 2023 · 2 comments

Comments

@sfallahpour
Copy link
Contributor

sfallahpour commented Dec 18, 2023

when i try the following command

imp_simpuatation<-impute_rhd(
  data,
  GI~age+sex,
  pool = "univariate",
  prob = data$SamplingWeight
)

i get the following error:

Error in impute_rhd(data, earnings ~ AG + sex, pool = "univariate", prob = data$SamplingWeight) : 
  length(prob) != nrow(dat) is not TRUE

I used a debugger function and i think there is a bug in the package which i believe is here:
image

I believe the highlighted line should be
stopifnot(length(prob) == nrow(dat))

@sfallahpour
Copy link
Contributor Author

@markvanderloo please see my suggestion above to fix the bug with impute_rhd function

@LukasWallrich
Copy link

On this note, could it be documented that prob is an optional parameter? Currently, it looks required, which made me get stuck with this issue until I noticed that I don't need to specify weights.

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

No branches or pull requests

2 participants