I use the tidycensus
R package all the time and cannot figure out how articles like this one used the Census 2019 1-year ACS estimates to produce stats like:
"In 2019, 22.5% of female same-sex couple households had children under 18 present, compared with 6.6% of male same-sex couple households." -- [from this Census article][1]
The Census variables available for same-sex households do not include children. Is there some way to intersect variables like these with children-specifying variables?
Same-sex variables (not many)
library(tidycensus)
library(dplyr)
#### Census API key
## Only need this line because API key stored in .Renviron
## If not stored, get Census API key at http://api.census.gov/data/key_signup.html then run
## census_api_key("PLACE CENSUS KEY HERE", install = TRUE)
## per https://rdrr.io/cran/tidycensus/man/census_api_key.html
Sys.getenv("CENSUS_API_KEY")
vars19 <- load_variables(2019, dataset = "acs1", cache = TRUE)
vars19 %>% dplyr::filter(grepl('SAME-SEX', toupper(label)))
# A tibble: 10 × 3
name label concept
<chr> <chr> <chr>
1 B09019_011 Estimate!!Total:!!In households:!!Same-sex spouse HOUSEHOLD TYPE (INCLUDING LIVING ALONE) BY RELATIONSHIP
2 B09019_013 Estimate!!Total:!!In households:!!Same-sex unmarried partner HOUSEHOLD TYPE (INCLUDING LIVING ALONE) BY RELATIONSHIP
3 B11009_004 Estimate!!Total:!!Married couple households:!!Same-sex: COUPLED HOUSEHOLDS BY TYPE
4 B11009_005 Estimate!!Total:!!Married couple households:!!Same-sex:!!Male householder and male spouse COUPLED HOUSEHOLDS BY TYPE
5 B11009_006 Estimate!!Total:!!Married couple households:!!Same-sex:!!Female householder and female spouse COUPLED HOUSEHOLDS BY TYPE
6 B11009_009 Estimate!!Total:!!Cohabiting couple households:!!Same-sex: COUPLED HOUSEHOLDS BY TYPE
7 B11009_010 Estimate!!Total:!!Cohabiting couple households:!!Same-sex:!!Male householder and male partner COUPLED HOUSEHOLDS BY TYPE
8 B11009_011 Estimate!!Total:!!Cohabiting couple households:!!Same-sex:!!Female householder and female partner COUPLED HOUSEHOLDS BY TYPE
9 B12504_005 Estimate!!Total:!!Male:!!Married, spouse present:!!Same-sex spouse MEDIAN DURATION OF CURRENT MARRIAGE IN YEARS BY SEX BY MARITAL S…
10 B12504_011 Estimate!!Total:!!Female:!!Married, spouse present:!!Same-sex spouse MEDIAN DURATION OF CURRENT MARRIAGE IN YEARS BY SEX BY MARITAL S…
An example of children-specifying variables.
> vars19 %>% dplyr::filter(concept == 'SUBFAMILY TYPE BY PRESENCE OF OWN CHILDREN UNDER 18 YEARS')
# A tibble: 6 × 3
name label concept
<chr> <chr> <chr>
1 B11013_001 Estimate!!Total: SUBFAMILY TYPE BY PRESENCE OF OWN CHILDREN UNDER 18 YEARS
2 B11013_002 Estimate!!Total:!!Married-couple subfamily: SUBFAMILY TYPE BY PRESENCE OF OWN CHILDREN UNDER 18 YEARS
3 B11013_003 Estimate!!Total:!!Married-couple subfamily:!!With own children under 18 years SUBFAMILY TYPE BY PRESENCE OF OWN CHILDREN UNDER 18 YEARS
4 B11013_004 Estimate!!Total:!!Married-couple subfamily:!!No own children under 18 years SUBFAMILY TYPE BY PRESENCE OF OWN CHILDREN UNDER 18 YEARS
5 B11013_005 Estimate!!Total:!!Mother-child subfamily SUBFAMILY TYPE BY PRESENCE OF OWN CHILDREN UNDER 18 YEARS
6 B11013_006 Estimate!!Total:!!Father-child subfamily SUBFAMILY TYPE BY PRESENCE OF OWN CHILDREN UNDER 18 YEARS
[1]: https://www.census.gov/library/stories/2020/09/fifteen-percent-of-same-sex-couples-have-children-in-their-household.html#:~:text=Fifteen%20percent%20(14.7%25)%20of,CPS)%20data%20released%20this%20week.