Error generating a chi-square test with data that has been converted from wide to long

Hi all,

I am using Demographic and Health Survey data. My end goal is to run multivariate logistic regressions. Since I am using complex data, I converted the data from wide to long. I continued with analyses and ran a chi-square test. I successfully ran this using two variables. Because I want to run an analyses using four variables that describe the same undernutrition indicator for four children and cross it with the urban and rural variable, I ran another chi-square, considering my data is correctly converted from wide to long to do this. Unfortunately, I got an error this time. Please be aware I am running analyses adjusting for survey design. Below codes and data output. Can you support me with the correct coding to run an appropiate conversion from wide to long and a code to run a chi-square test appropiately?

library(haven)

HNIR62FL_data_2 <- readta that has been converted from wide to long?_sav("~/DHS/HNIR62SV/HNIR62FL_data_2.SAV")

View(HNIR62FL_data_2)

obsHNIR62FL_data_2 <- subset(HNIR62FL_data_2, !is.na(V021) & !is.na(V022) & !is.na(D005))

myvars <- c("CASEID", "V013", "V021", "V022", "V025", "V106", "V137", "V190", "V714", "D005", "D104", "D106", "D107", "D108","v1014", "v1016", "v1021", "v1023", "v1038", "v1039", "v1045", "v1113", "V701", "v1007_1", "v1007_2", "v1007_3", "v1007_4", "v1008_1", "v1008_2", "v1008_3", "v1008_4", "v1009_1", "v1009_2", "v1009_3", "v1009_4", "v1010_1", "v1010_2", "v1010_3", "v1010_4", "v1020_1", "v1020_2", "v1020_3", "v1020_4", "v1071_1", "v1071_2", "v1071_3", "v1071_4", "v1088_1", "v1088_2", "v1088_3", "v1088_4", "v1096_1", "v1096_2", "v1096_3", "v1096_4", "v1104_1", "v1104_2", "v1104_3", "v1104_4", "v1111_1", "v1111_2", "v1111_3", "v1111_4", "v1112_1", "v1112_2", "v1112_3", "v1112_4")

newobsHNIR62FL_data_2 <- obsHNIR62FL_data_2[myvars]

dhsdesign <- svydesign(newobsHNIR62FL_data_2$V021, strata = newobsHNIR62FL_data_2$V022, weights = newobsHNIR62FL_data_2$D005/1000000, data = newobsHNIR62FL_data_2)

newobsHNIR62FL_data_2 %>% mutate(across(starts_with(c("V", "v")), as.double)) %>% pivot_longer(cols=starts_with(c("V", "v")), names_to = c("name", "id"), values_to = "value", names_sep = "_")

`A tibble: 379,237 x 9
CASEID D005 D104 D106 D107 D108 name id value
<dbl+lb> <dbl+lb> <dbl+l> <dbl+l>
1 " 564 9~ 1758042 0 [No] 0 [No] 0 [No] 0 [No] V013 NA 2
2 " 564 9~ 1758042 0 [No] 0 [No] 0 [No] 0 [No] V021 NA 564
3 " 564 9~ 1758042 0 [No] 0 [No] 0 [No] 0 [No] V022 NA 16
4 " 564 9~ 1758042 0 [No] 0 [No] 0 [No] 0 [No] V025 NA 1
5 " 564 9~ 1758042 0 [No] 0 [No] 0 [No] 0 [No] V106 NA 1
6 " 564 9~ 1758042 0 [No] 0 [No] 0 [No] 0 [No] V137 NA 2
7 " 564 9~ 1758042 0 [No] 0 [No] 0 [No] 0 [No] V190 NA 3
8 " 564 9~ 1758042 0 [No] 0 [No] 0 [No] 0 [No] V714 NA 0
9 " 564 9~ 1758042 0 [No] 0 [No] 0 [No] 0 [No] v1014 NA 2
10 " 564 9~ 1758042 0 [No] 0 [No] 0 [No] 0 [No] v1016 NA 1

... with 379,227 more rows`

Warning message:
Expected 2 pieces. Missing pieces filled with `NA` in 17 rows [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17].

summary(svytable(~v1113+v1039, dhsdesign))

v1039
v1113    1    2    3    4
    0 1087  934  626  646
    1  462  518  388  359

	Pearson's X^2: Rao & Scott adjustment

data:  svychisq(~v1113 + v1039, design = dhsdesign, statistic = "F")
F = 5.4626, ndf = 2.9836, ddf = 3243.1635, p-value = 0.0009852`

summary(svytable(~v1007_1 + v1007_2+ v1007_3 + v1007_4 + V025, dhsdesign))

Error in svychisq.survey.design(~v1007_1 + v1007_2 + v1007_3 + v1007_4 +  : 
  Only 2-way tables at the moment

dput(head(newobsHNIR62FL_data_2))

`structure(list(CASEID = structure(c("      564 91  2", "      198 61  2", 
"      267 21  1", "     1089 81  2", "      583 61  8", "      989101  2"
), label = "Case Identification", format.spss = "A15", display_width = 17L), 
    V013 = structure(c(2, 4, 4, 4, 6, 3), label = "Age in 5-year groups", format.spss = "F1.0", display_width = 6L, labels = c(`15-19` = 1, 
    `20-24` = 2, `25-29` = 3, `30-34` = 4, `35-39` = 5, `40-44` = 6, 
    `45-49` = 7), class = c("haven_labelled", "vctrs_vctr", "double"
    )), V021 = structure(c(564, 198, 267, 1089, 583, 989), label = "Primary sampling unit", format.spss = "F4.0", display_width = 6L), 
    V022 = structure(c(16, 8, 9, 37, 17, 33), label = "Sample strata for sampling errors", format.spss = "F4.0", display_width = 6L, labels = c(`Atlántida Urbano` = 1, 
    `Atlántida Rural` = 2, `Colón Urbano` = 3, `Colón Rural` = 4, 
    `Comayagua Urbano` = 5, `Comayagua Rural` = 6, `Copán Urbano` = 7, 
    `Copán Rural` = 8, `San Pedro Sula Urbano` = 9, `Cortés Resto Urbano` = 10, 
    `Cortés Resto Rural` = 11, `Choluteca Urbano` = 12, `Choluteca Rural` = 13, 
    `El Paraíso Urbano` = 14, `El Paraíso Rural` = 15, `Tegucigalpa Urbano` = 16, 
    `Morazán Resto Urbano` = 17, `Morazán Resto Rural` = 18, 
    `Gracias a Dios Urbano` = 19, `Gracias a Dios Rural` = 20, 
    `Intibucá Urbano` = 21, `Intibucá Rural` = 22, `Islas de Bahía Urbano` = 23, 
    `Islas de Bahía Rural` = 24, `La Paz Urbano` = 25, `La Paz Rural` = 26, 
    `Lempira Urbano` = 27, `Lempira Rural` = 28, `Ocotepeque Urbano` = 29, 
    `Ocotepeque Rural` = 30, `Olancho Urbano` = 31, `Olancho Rural` = 32, 
    `Santa Bárbara Urbano` = 33, `Santa Bárbara Rural` = 34, 
    `Valle Urbano` = 35, `Valle Rural` = 36, `Yoro Urbano` = 37, 
    `Yoro Rural` = 38), class = c("haven_labelled", "vctrs_vctr", 
    "double")), V025 = structure(c(1, 2, 1, 1, 1, 1), label = "Type of place of residence", format.spss = "F1.0", display_width = 6L, labels = c(Urban = 1, 
    Rural = 2), class = c("haven_labelled", "vctrs_vctr", "double"
    )), V106 = structure(c(1, 0, 1, 1, 1, 2), label = "Highest educational level", format.spss = "F1.0", display_width = 6L, labels = c(`No education` = 0, 
    Primary = 1, Secondary = 2, Higher = 3), class = c("haven_labelled", 
    "vctrs_vctr", "double")), V137 = structure(c(2, 2, 2, 1, 
    0, 1), label = "Number of children 5 and under in household (de jure)", format.spss = "F2.0", display_width = 6L), 
    V190 = structure(c(3, 1, 2, 4, 2, 4), label = "Wealth index", format.spss = "F1.0", display_width = 6L, labels = c(Poorest = 1, 
    Poorer = 2, Middle = 3, Richer = 4, Richest = 5), class = c("haven_labelled", 
    "vctrs_vctr", "double")), V714 = structure(c(0, 0, 1, 1, 
    0, 0), label = "Respondent currently working", format.spss = "F1.0", display_width = 6L, labels = c(No = 0, 
    Yes = 1), class = c("haven_labelled", "vctrs_vctr", "double"
    )), D005 = structure(c(1758042, 927099, 1296895, 1087346, 
    1005935, 1112882), label = "Weight for Domestic Violence (6 decimals)", format.spss = "F8.0", display_width = 10L), 
    D104 = structure(c(0, 0, 0, 0, 0, 0), label = "Experienced any emotional violence", format.spss = "F1.0", display_width = 6L, labels = c(No = 0, 
    Yes = 1), class = c("haven_labelled", "vctrs_vctr", "double"
    )), D106 = structure(c(0, 0, 0, 0, 0, 0), label = "Experienced any less severe violence (D105A-C,J) by husband/partner", format.spss = "F1.0", display_width = 6L, labels = c(No = 0, 
    `Yes (D105A-D)` = 1), class = c("haven_labelled", "vctrs_vctr", 
    "double")), D107 = structure(c(0, 0, 0, 0, 0, 0), label = "Experienced any severe violence (D105D-F) by husband/partner", format.spss = "F1.0", display_width = 6L, labels = c(No = 0, 
    `Yes (D105E-G)` = 1), class = c("haven_labelled", "vctrs_vctr", 
    "double")), D108 = structure(c(0, 0, 0, 0, 0, 0), label = "Experienced any sexual violence (D105H-I,K) by husband/partner", format.spss = "F1.0", display_width = 6L, labels = c(No = 0, 
    `Yes (D105H-I)` = 1), class = c("haven_labelled", "vctrs_vctr", 
    "double")), v1014 = structure(c(2, 2, 2, 4, 2, 4), label = "women BMI category", format.spss = "F8.0", labels = c(underweight = 1, 
    `normal weight` = 2, overweight = 3, obese = 4), class = c("haven_labelled", 
    "vctrs_vctr", "double")), v1016 = structure(c(1, 0, 0, 1, 
    0, 1), label = "women height category", format.spss = "F8.0", labels = c(`woman height <150 cm` = 0, 
    `woman height 150 cm or more ` = 1), class = c("haven_labelled", 
    "vctrs_vctr", "double")), v1021 = structure(c(4, 3, 1, 1, 
    4, 3), label = "region category", format.spss = "F8.0", labels = c(Northern = 1, 
    Southern = 2, Western = 3, Central = 4, Eastern = 5), class = c("haven_labelled", 
    "vctrs_vctr", "double")), v1023 = structure(c(2, 5, 3, 2, 
    4, 1), label = "parity", format.spss = "F8.0", labels = c(`0` = 0, 
    `1` = 1, `2` = 2, `3` = 3, `4` = 4, `5 or more` = 5), class = c("haven_labelled", 
    "vctrs_vctr", "double")), v1038 = structure(c(2, 1, 3, 2, 
    2, 2), label = "marital status", format.spss = "F8.0", labels = c(`Never in union` = 0, 
    Married = 1, `Living with partner ` = 2, `Divorced, widowed or separated/no longer living together` = 3
    ), class = c("haven_labelled", "vctrs_vctr", "double")), 
    v1039 = structure(c(2, 4, 3, 2, 3, 1), label = "marital duration", format.spss = "F8.0", labels = c(`Never in a union` = 0, 
    `0-4 years` = 1, `5-9 years` = 2, `10-14 years` = 3, `15 years or more` = 4
    ), class = c("haven_labelled", "vctrs_vctr", "double")), 
    v1045 = structure(c(4, 4, NA, 3, 1, 4), label = "Women decision making scale", format.spss = "F8.0", labels = c(`No decision making skills` = 0, 
    `Respondent alone/respondent and husband/partner decide on one issue` = 1, 
    `Respondent alone/respondent and husband/partner decide on two issues` = 2, 
    `Respondent alone/respondent and husband/partner decide on three issues` = 3, 
    `Respondent alone/respondent and husband/partner decide on four issues` = 4
    ), class = c("haven_labelled", "vctrs_vctr", "double")), 
    v1113 = structure(c(0, 0, 0, 0, 0, 0), label = "Any intimate partner violence", format.spss = "F8.0", labels = c(`Has not experienced any form of intimate partner violence` = 0, 
    `Has experienced any form of intimate partner violence` = 1
    ), class = c("haven_labelled", "vctrs_vctr", "double")), 
    V701 = structure(c(2, 1, 1, 2, 2, 2), label = "Husband/partner's education level", format.spss = "F1.0", display_width = 6L, labels = c(`No education` = 0, 
    Primary = 1, Secondary = 2, Higher = 3, `Don't know` = 8), class = c("haven_labelled", 
    "vctrs_vctr", "double")), v1007_1 = structure(c(NA_real_, 
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), label = "youngest child stunting category", format.spss = "F8.0", labels = c(`stunted child ` = 0, 
    `not stunted child` = 1), class = c("haven_labelled", "vctrs_vctr", 
    "double")), v1007_2 = structure(c(1, 0, 0, NA, NA, NA), label = "stunting category (second to youngest child)", format.spss = "F8.0", labels = c(stunted = 0, 
    `not stunted` = 1), class = c("haven_labelled", "vctrs_vctr", 
    "double")), v1007_3 = structure(c(NA_real_, NA_real_, NA_real_, 
    NA_real_, NA_real_, NA_real_), label = "stunting category (third to youngest child)", format.spss = "F8.0", labels = c(stunted = 0, 
    `not stunted` = 1), class = c("haven_labelled", "vctrs_vctr", 
    "double")), v1007_4 = structure(c(NA_real_, NA_real_, NA_real_, 
    NA_real_, NA_real_, NA_real_), label = "stunting category (fourth to youngest child)", format.spss = "F8.0", labels = c(stunted = 0, 
    `not stunted` = 1), class = c("haven_labelled", "vctrs_vctr", 
    "double")), v1008_1 = structure(c(NA_real_, NA_real_, NA_real_, 
    NA_real_, NA_real_, NA_real_), label = "youngest child underweight category", format.spss = "F8.0", labels = c(`underweight child` = 0, 
    `not underweight child` = 1), class = c("haven_labelled", 
    "vctrs_vctr", "double")), v1008_2 = structure(c(1, 1, 0, 
    NA, NA, NA), label = "underweight category (second to youngest child)", format.spss = "F8.0", labels = c(underweight = 0, 
    `not underweight` = 1), class = c("haven_labelled", "vctrs_vctr", 
    "double")), v1008_3 = structure(c(NA_real_, NA_real_, NA_real_, 
    NA_real_, NA_real_, NA_real_), label = "underweight category (third to youngest child)", format.spss = "F8.0", labels = c(underweight = 0, 
    `not underweight` = 1), class = c("haven_labelled", "vctrs_vctr", 
    "double")), v1008_4 = structure(c(NA_real_, NA_real_, NA_real_, 
    NA_real_, NA_real_, NA_real_), label = "underweight category (fourth to youngest child)", format.spss = "F8.0", labels = c(underweight = 0, 
    `not underweight` = 1), class = c("haven_labelled", "vctrs_vctr", 
    "double")), v1009_1 = structure(c(NA_real_, NA_real_, NA_real_, 
    NA_real_, NA_real_, NA_real_), label = "youngest child wasting category", format.spss = "F8.0", labels = c(`wasted child` = 0, 
    `not wasted child ` = 1), class = c("haven_labelled", "vctrs_vctr", 
    "double")), v1009_2 = structure(c(1, 1, 1, NA, NA, NA), label = "wasting category (second to youngest child)", format.spss = "F8.0", labels = c(wasted = 0, 
    `not wasted` = 1), class = c("haven_labelled", "vctrs_vctr", 
    "double")), v1009_3 = structure(c(NA_real_, NA_real_, NA_real_, 
    NA_real_, NA_real_, NA_real_), label = "wasting category (third to youngest child)", format.spss = "F8.0", labels = c(wasted = 0, 
    `not wasted ` = 1), class = c("haven_labelled", "vctrs_vctr", 
    "double")), v1009_4 = structure(c(NA_real_, NA_real_, NA_real_, 
    NA_real_, NA_real_, NA_real_), label = "wasting category (fourth to youngest child)", format.spss = "F8.0", labels = c(wasted = 0, 
    `not wasted` = 1), class = c("haven_labelled", "vctrs_vctr", 
    "double")), v1010_1 = structure(c(NA_real_, NA_real_, NA_real_, 
    NA_real_, NA_real_, NA_real_), label = "youngest child overweight category", format.spss = "F8.0", labels = c(`overweight child` = 0, 
    `not overweight child ` = 1), class = c("haven_labelled", 
    "vctrs_vctr", "double")), v1010_2 = structure(c(1, 1, 1, 
    NA, NA, NA), label = "overweight category (second to youngest child)", format.spss = "F8.0", labels = c(overweight = 0, 
    `not overweight` = 1), class = c("haven_labelled", "vctrs_vctr", 
    "double")), v1010_3 = structure(c(NA_real_, NA_real_, NA_real_, 
    NA_real_, NA_real_, NA_real_), label = "overweight category (third to youngest child)", format.spss = "F8.0", labels = c(overweight = 0, 
    `not overweight` = 1), class = c("haven_labelled", "vctrs_vctr", 
    "double")), v1010_4 = structure(c(NA_real_, NA_real_, NA_real_, 
    NA_real_, NA_real_, NA_real_), label = "overweight category (fourth to youngest child)", format.spss = "F8.0", labels = c(overweight = 0, 
    `not overweight` = 1), class = c("haven_labelled", "vctrs_vctr", 
    "double")), v1020_1 = structure(c(1, 0, 1, 0, 1, 0), label = "youngest child morbidity category", format.spss = "F8.0", labels = c(`youngest child with no morbidity` = 0, 
    `youngest child with morbidity ` = 1), class = c("haven_labelled", 
    "vctrs_vctr", "double")), v1020_2 = structure(c(1, 0, 1, 
    NA, NA, NA), label = "Morbidity category (second to youngest child)", format.spss = "F8.0", labels = c(`youngest child with no morbidity` = 0, 
    `youngest child with morbidity` = 1), class = c("haven_labelled", 
    "vctrs_vctr", "double")), v1020_3 = structure(c(NA_real_, 
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), label = "Morbidity category (third to youngest child)", format.spss = "F8.0", labels = c(`youngest child with no morbidity` = 0, 
    `youngest child with morbidity` = 1), class = c("haven_labelled", 
    "vctrs_vctr", "double")), v1020_4 = structure(c(NA_real_, 
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), label = "Morbidity category (fourth to youngest child)", format.spss = "F8.0", labels = c(`youngest child with no morbidity` = 0, 
    `youngest child with morbidity` = 1), class = c("haven_labelled", 
    "vctrs_vctr", "double")), v1071_1 = structure(c(0, NA, 1, 
    1, 1, 1), label = "anemia category (youngest child)", format.spss = "F8.0", labels = c(anemic = 0, 
    `not anemic` = 1), class = c("haven_labelled", "vctrs_vctr", 
    "double")), v1071_2 = structure(c(1, 1, 0, NA, NA, NA), label = "anemia category (second to youngest child)", format.spss = "F8.0", labels = c(anemic = 0, 
    `not anemic` = 1), class = c("haven_labelled", "vctrs_vctr", 
    "double")), v1071_3 = structure(c(NA_real_, NA_real_, NA_real_, 
    NA_real_, NA_real_, NA_real_), label = "anemia category (third to youngest child)", format.spss = "F8.0", labels = c(anemic = 0, 
    `not anemic` = 1), class = c("haven_labelled", "vctrs_vctr", 
    "double")), v1071_4 = structure(c(NA_real_, NA_real_, NA_real_, 
    NA_real_, NA_real_, NA_real_), label = "anemia category (fourth to youngest child)", format.spss = "F8.0", labels = c(anemic = 0, 
    `not anemic` = 1), class = c("haven_labelled", "vctrs_vctr", 
    "double")), v1088_1 = structure(c(NA_real_, NA_real_, NA_real_, 
    NA_real_, NA_real_, NA_real_), label = "youngest child stunting + overweight category", format.spss = "F8.0", labels = c(`stunted and overweight child` = 0, 
    `not stunted and overweight child` = 1), class = c("haven_labelled", 
    "vctrs_vctr", "double")), v1088_2 = structure(c(1, 1, NA, 
    NA, NA, NA), label = "second to youngest child stunting + overweight category", format.spss = "F8.0", labels = c(`stunted and overweight child` = 0, 
    `not stunted and overweight child` = 1), class = c("haven_labelled", 
    "vctrs_vctr", "double")), v1088_3 = structure(c(NA_real_, 
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), label = "third to youngest child stunting + overweight category", format.spss = "F8.0", labels = c(`stunted and overweight child ` = 0, 
    `not stunted and overweight child` = 1), class = c("haven_labelled", 
    "vctrs_vctr", "double")), v1088_4 = structure(c(NA_real_, 
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), label = "fourth to youngest child stunting + overweight category", format.spss = "F8.0", labels = c(`stunted and overweight child ` = 0, 
    `not stunted and overweight child` = 1), class = c("haven_labelled", 
    "vctrs_vctr", "double")), v1096_1 = structure(c(NA_real_, 
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), label = "youngest child anemic + overweight category", format.spss = "F8.0", labels = c(`anemic and overweight child ` = 0, 
    `not anemic and overweight child` = 1), class = c("haven_labelled", 
    "vctrs_vctr", "double")), v1096_2 = structure(c(1, 1, 1, 
    NA, NA, NA), label = "second to youngest child anemic + overweight category", format.spss = "F8.0", labels = c(`anemic and overweight child ` = 0, 
    `not anemic and overweight child ` = 1), class = c("haven_labelled", 
    "vctrs_vctr", "double")), v1096_3 = structure(c(NA_real_, 
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), label = "third to youngest child anemic + overweight category", format.spss = "F8.0", labels = c(`anemic and overweight child ` = 0, 
    `not anemic and overweight child ` = 1), class = c("haven_labelled", 
    "vctrs_vctr", "double")), v1096_4 = structure(c(NA_real_, 
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), label = "fourth to youngest child anemic + overweight category", format.spss = "F8.0", labels = c(`anemic and overweight child ` = 0, 
    `not anemic and overweight child` = 1), class = c("haven_labelled", 
    "vctrs_vctr", "double")), v1104_1 = structure(c(NA_real_, 
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), label = "youngest child anemic + stunted category", format.spss = "F8.0", labels = c(`anemic and stunted child` = 0, 
    `not anemic and not stunted child ` = 1), class = c("haven_labelled", 
    "vctrs_vctr", "double")), v1104_2 = structure(c(1, 1, NA, 
    NA, NA, NA), label = "second to youngest child anemic + stunted category", format.spss = "F8.0", labels = c(`anemic and stunted child ` = 0, 
    `not anemic and stunted child ` = 1), class = c("haven_labelled", 
    "vctrs_vctr", "double")), v1104_3 = structure(c(NA_real_, 
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), label = "third to youngest child anemic + stunted category", format.spss = "F8.0", labels = c(`anemic and stunted child ` = 0, 
    `not anemic and stunted child ` = 1), class = c("haven_labelled", 
    "vctrs_vctr", "double")), v1104_4 = structure(c(NA_real_, 
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), label = "fourth to youngest child anemic + stunted category", format.spss = "F8.0", labels = c(`stunted and anemic child` = 0, 
    `not stunted and anemic child` = 1), class = c("haven_labelled", 
    "vctrs_vctr", "double")), v1111_1 = structure(c(3, 1, 4, 
    4, 5, 6), label = "Child age (youngest child)", format.spss = "F8.0", labels = c(`0-5 months` = 1, 
    `6-11 months` = 2, `12-23 months` = 3, `24-35 months` = 4, 
    `36-47 months` = 5, `48-59 months` = 6), class = c("haven_labelled", 
    "vctrs_vctr", "double")), v1111_2 = structure(c(6, 5, 6, 
    NA, NA, NA), label = "Child age (second to youngest)", format.spss = "F8.0", labels = c(`0-5 months` = 1, 
    `6-11 months` = 2, `12-23 months` = 3, `24-35 months` = 4, 
    `36-47 months` = 5, `48-59 months` = 6), class = c("haven_labelled", 
    "vctrs_vctr", "double")), v1111_3 = structure(c(NA_real_, 
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), label = "Child age (third to youngest)", format.spss = "F8.0", labels = c(`0-5 months` = 1, 
    `6-11 months` = 2, `12-23 months` = 3, `24-35 months` = 4, 
    `36-47 months` = 5, `48-59 months` = 6), class = c("haven_labelled", 
    "vctrs_vctr", "double")), v1111_4 = structure(c(NA_real_, 
    NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), label = "Child age (fourth to youngest)", format.spss = "F8.0", labels = c(`0-5 months` = 1, 
    `6-11 months` = 2, `12-23 months` = 3, `24-35 months` = 4, 
    `36-47 months` = 5, `48-59 months` = 6), class = c("haven_labelled", 
    "vctrs_vctr", "double")), v1112_1 = structure(c(2, 2, 1, 
    1, 1, 1), label = "Sex of child", format.spss = "F1.0", display_width = 7L, labels = c(Male = 1, 
    Female = 2), class = c("haven_labelled", "vctrs_vctr", "double"
    )), v1112_2 = structure(c(1, 2, 1, 2, 1, NA), label = "Sex of child", format.spss = "F1.0", display_width = 7L, labels = c(Male = 1, 
    Female = 2), class = c("haven_labelled", "vctrs_vctr", "double"
    )), v1112_3 = structure(c(NA, 2, 1, NA, 2, NA), label = "Sex of child", format.spss = "F1.0", display_width = 7L, labels = c(Male = 1, 
    Female = 2), class = c("haven_labelled", "vctrs_vctr", "double"
    )), v1112_4 = structure(c(NA, 2, NA, NA, 1, NA), label = "Sex of child", format.spss = "F1.0", display_width = 7L, labels = c(Male = 1, 
    Female = 2), class = c("haven_labelled", "vctrs_vctr", "double"
    ))), row.names = c(NA, -6L), class = c("tbl_df", "tbl", "data.frame"
))`

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.