Script to assign religion and socioeconomic status
- or -
Post a project like this$100
- Posted:
- Proposals: 2
- Remote
- #3220456
- Expired
Description
Experience Level: Entry
Estimated project duration: less than 1 week
I have a database from the 2002 census in Chile and I need to impute a religion to children 4 years old or younger from the religion of the head of household and to impute a socioeconomic level to all individuals for my research.
I am working in R.
I made a vector to identify the specific unique household number registered in the census called "codigo" and I created two dataframes, one with the children 4 years old or younger and another with the heads of household.
What I am looking for is that if the child and the head of household share the same household, the religion of the head of household is assigned to the child (<=4).
I tried to use ifelse and other solutions like loops but I can't solve the problem.
I need a solution to the problem in a script that I can run to execute this task and the resulting child dataframe with the religion assignment.
I also need to assign a socioeconomic level (NSE) to each household and each person in the household according to the ID variable ("codigo"). To create the NSE I need to use the number of assets of the household ("censo2002_h$numero_bienes" variable) and the educational level of the head of household ("censo2002_p_jefes_educcion$educacional").
This is assigned as established by this two-variable matrix
https://mega.nz/file/23IEFZJI#pLa41VhFUsA_uoSkaV4DxYF7fQKE8QKQNgJ4pm1qpjw
I have two dataframes, the heads of household with their educational level ("censo2002_p_jefes_jefes_educcion$educacional") and the households with their number of assets ("censo2002_h$numero_bienes").
The idea is that if the conditions of each cell are met: In the same household if n assets and x educational level of the head of household, then the corresponding NSE (E, D, C3, C2, ABC1) is assigned to the household and then the NSE is assigned to all persons in the household in a new column (the dataframe "census2002_p").
Attached is a csv of the original individuals database:
https://mega.nz/file/b2hA0QZJ#LvhFwvR5F2u20hcpUPGE6EnA3r-bKgfqbJsjHhNVsZ0
and the houshold database:
https://mega.nz/file/73AymRbS#3a8Ip0IjEpOR31503GKIh6xwew9mFurDe3i88KFCI7w
and provisional script of the dataframes I mention.
Thanks
PS: In the dataframe the following columns are:
P17= Relationship to head of household.
P19= Age
P28= Religion
codigo= Unique Household ID
I am working in R.
I made a vector to identify the specific unique household number registered in the census called "codigo" and I created two dataframes, one with the children 4 years old or younger and another with the heads of household.
What I am looking for is that if the child and the head of household share the same household, the religion of the head of household is assigned to the child (<=4).
I tried to use ifelse and other solutions like loops but I can't solve the problem.
I need a solution to the problem in a script that I can run to execute this task and the resulting child dataframe with the religion assignment.
I also need to assign a socioeconomic level (NSE) to each household and each person in the household according to the ID variable ("codigo"). To create the NSE I need to use the number of assets of the household ("censo2002_h$numero_bienes" variable) and the educational level of the head of household ("censo2002_p_jefes_educcion$educacional").
This is assigned as established by this two-variable matrix
https://mega.nz/file/23IEFZJI#pLa41VhFUsA_uoSkaV4DxYF7fQKE8QKQNgJ4pm1qpjw
I have two dataframes, the heads of household with their educational level ("censo2002_p_jefes_jefes_educcion$educacional") and the households with their number of assets ("censo2002_h$numero_bienes").
The idea is that if the conditions of each cell are met: In the same household if n assets and x educational level of the head of household, then the corresponding NSE (E, D, C3, C2, ABC1) is assigned to the household and then the NSE is assigned to all persons in the household in a new column (the dataframe "census2002_p").
Attached is a csv of the original individuals database:
https://mega.nz/file/b2hA0QZJ#LvhFwvR5F2u20hcpUPGE6EnA3r-bKgfqbJsjHhNVsZ0
and the houshold database:
https://mega.nz/file/73AymRbS#3a8Ip0IjEpOR31503GKIh6xwew9mFurDe3i88KFCI7w
and provisional script of the dataframes I mention.
Thanks
PS: In the dataframe the following columns are:
P17= Relationship to head of household.
P19= Age
P28= Religion
codigo= Unique Household ID
PPH User P.
80% (2)Projects Completed
1
Freelancers worked with
1
Projects awarded
0%
Last project
24 Apr 2021
Chile
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies