Displaying 4 results from an estimated 4 matches for "ipumsi_00008_dta".
2020 Oct 30
3
Error: variable not found
...use summary(dataset), those new variables appear in the summary of the dataset.
But, when I do summary(new variable) => error: variable not found.
For example: summary(couple_id) => Error in summary(couple_id) : object 'couple_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_...
2020 Oct 29
0
Creating unique code
...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 do what you want:
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 204...
2020 Oct 30
0
Error: variable not found
Hi Hannah,
Using the same code I sent before, 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 204...
2020 Oct 27
2
Creating unique code
...use
* 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)
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
ipumsi_00008_dta <- mutate(ipumsi_00008_dta, sploc_greater_than_zero = sploc>...