search for: sprule

Displaying 4 results from an estimated 4 matches for "sprule".

Did you mean: spruce
2020 Oct 27
2
Creating unique code
...ousehold. So, I can identify couples. To do this, I should use 4 variables: * SERIAL = a unique numeric code for each household * PERNUM = a unique numeric code for each person * SPLOC = the numeric code of the spouse in the household, it is equal to the PERNUM code of the spouse * SPRULE = rules for linking a spouse, numeric code from 00 to 06 To create the couple identifier, I need these conditions: * SERIAL needs to be equal for these persons in the couples * SPLOC > 0 * SPLOC = PERNUM * SPRULE = 01 or 02 What I already did is this: attach(ipumsi_00008_dta...
2020 Oct 30
3
Error: variable not found
...id' not found. What can I do about this? R-script: attach(ipumsi_00008_dta) library(tinytex) library(dplyr) library(ggplot2) library(tidyr) library(knitr) library(forcats) library(mice) library(pander) library(ggcorrplot) library(lubridate) # true/false code when sploc is greater than zero and sprule is equal to 1 or 2 ipumsi_00008_dta <- mutate(ipumsi_00008_dta, rule_union = sploc>0 & (sprule==1 | sprule==2)) ## creating numeric code for rule_union & rule_unionn: 1 when sploc is greater than zero and sprule is equal to 1 or 2, 0 if not. ## This is neccesary because otherwise it i...
2020 Oct 29
0
Creating unique code
Hi Hannah, Yes, that does give me more insight. The polygyny only doesn't matter, for even if there was polyandry it could be coded in the same way. If I understand this correctly you have one variable (SPRULE) that must contain information about the household of the individual and the identities of his (or her) relationship partner(s). The household number can accommodate up to three relationship partners as long as there are a maximum of 9 people per household. Given these constraints, I think this may...
2020 Oct 30
0
Error: variable not found
...e, you can append the partner codes to the household code. I apologize, but I don't know how to use the dplyr/tidyr/... stuff so this is written in straight R code using logic statements. ipumsi_00008_dta<- read.table( text="country year sample serial hhwt pernum perwt resident sploc sprule 204 2013 204201301 4000 10 1 10 1 5 2 204 2013 204201301 4000 10 2 10 1 0 2 204 2013 204201301 4000 10 3 10 1 0 2 204 2013 204201301 4000 10 4 10 1 0 2 204 2013 204201301 4000 10 5 10 1 1 2 204 2013 204201301 4000 10 6 10 1 1 2 204 2013 204201301 4000 10 7 10 1 0 2 204 2013 204201301 4000 10 8 10 1...