Closed seb-garcia closed 8 months ago
Hi, @seb-garcia. On your first question, the condition P501 < 6 | P501B < 6) & P205_A > 17
seems to return NA
for some households. Here's my workaround but you should decide on how to treat these NA
s. In my case, I coerced NA
equal to 0
.
deprivation_profile$year_schooling <- df_household_roster |>
mutate(deprived_year_schooling = if_else((P501 < 6 | P501B < 6) & P205_A > 17, 1, 0, 0)) |>
define_deprivation(
.indicator = year_schooling,
.cutoff = deprived_year_schooling == 1,
.collapse = TRUE
)
I will include additional argument in define_deprivation
on how to treat NA
as a result of evaluating the deprivation cutoff, so you don't need to do extra steps doing data transformation. Watch out for the next release.
On your other query, yes, you can definitely apply a weighting vector to the deprivation_matrix
object returned by using compute_mpi
. Please note, though, that compute_mpi
is already applying the weights that you define in your specification file under the hood.
See #18
Hello from Peru I am very interested in the work you have done with the MPI. It has been helping us so much on a report we are writing to assess living conditions of Venezuelan refugees and migrants in Peru.
I am trying to implement your package into a NSO survey applied to Venezuelan population (ENPOVE 2022)* in Peru. Our repository is at this github Repo.
I am facing a problem on how the cutoff threshold works. First, I have tried to use a condition using dplyr grammar:
And I get this error message:
However when I do:
The code works just right.
Do you know what the issue is? Could you help us figure out what is the problem?
Moreover, I assume after I get the deprivation_matrix as an output I can apply a weighting vector to extrapolate the results. Would it work?
Thank you so much for your help!
*Microdata can be downloaded from INEI's website: For Household
For household members