Modified

December 4, 2024

About

This page shows some simple visualizations of the cleaned aggregate home visit questionnaire data file.

Setup

Load dependencies.

Code
suppressPackageStartupMessages(library(tidyverse))
suppressPackageStartupMessages(library(wordcloud))
suppressPackageStartupMessages(library(RColorBrewer))

source("../R/mcdi_viz_wordcloud.R")
source("../R/ecbq_plot.R")
source("../R/ecbq_plot_chunk.R")

Load saved “latest” data file.

Code
hv <- readr::read_csv("../data/csv/home_visit/agg/PLAY-non-mcdi-kobo-latest.csv", show_col_types = FALSE)

Child age

Child age in months (age_group) by child_sex.

Note: The child’s exact age in months is part of the Databrary-related data. That is on the work plan.

Code
home_visit_filtered <- hv |>
  dplyr::filter(!is.na(age_group),
                !is.na(child_sex))
Code
xtabs(formula = ~ age_group + child_sex, 
      data = home_visit_filtered)
         child_sex
age_group female male
     12mo    166  140
     18mo    142  166
     24mo    126  123

A total of \(n=\) 863 mother-infant dyads have been tested. This includes training and pilot visits.

Code
home_visit_filtered |>
  ggplot() +
  aes(age_group, fill = child_sex) +
  geom_bar() +
  theme(legend.position = "bottom") +
  theme(legend.title = element_blank())
Figure 10.1: Participants by age group and sex

Time series

To calculate cumulative visits, we have to add an index variable

Code
df <- home_visit_filtered |>
  dplyr::select(test_date, site_id) |>
  dplyr::mutate(test_date = as.Date(test_date)) |>
  dplyr::arrange(test_date) |>
  dplyr::mutate(n_visits = seq_along(test_date))
Code
df |>
  dplyr::filter(!is.na(test_date),
                !is.na(n_visits),
                !is.na(site_id)) |>
  ggplot() +
  aes(test_date, n_visits) +
  geom_point()
Figure 10.2: Cumulative home visits by year

Language exposure

Code
df <- hv |>
  dplyr::mutate(language_child = stringr::str_replace_all(language_child, " ", "_"))
xtabs(formula = ~ child_sex + language_child, data = df)
         language_child
child_sex english english_spanish
   female     348              86
   male       335              94
Note

The current workflow seems to omit Spanish-only families. This must be investigated further.

MB-CDI

Warning

We have temporarily disabled these visualizations while we conform them to a newer workflow.

12-mo-old English speakers

Code
eng_12 <-
  readr::read_csv(
    file.path(here::here(), "data/csv/home_visit/agg/mcdi_english_12_combined.csv"),
    col_types = readr::cols(.default = 'c'),
    show_col_types = FALSE
  )

There are some duplicate columns we must merge.

Code
eng_12_long <- eng_12 |>
  dplyr::mutate(bath = case_when(!is.na(bath_1) ~ bath_1,
                                 !is.na(bath_2) ~ bath_2,
                                 !is.na(bath_3) ~ bath_3,
                                 !is.na(bath_4) ~ bath_4)) |>
  dplyr::select(-contains("bath_")) |>
  dplyr::mutate(choo_choo = case_when(!is.na(choo_choo) ~ choo_choo,
                                      !is.na(choochoo) ~ choochoo)) |>
  dplyr::select(-choochoo) |>
  dplyr::mutate(I = case_when(!is.na(I) ~ I,
                              !is.na(i) ~ i)) |>
  dplyr::select(-i) |>
  dplyr::mutate(mommy = case_when(!is.na(mommy_1) ~ mommy_1,
                                  !is.na(mommy_2) ~ mommy_2)) |>
  dplyr::select(-contains("mommy_")) |>
  dplyr::mutate(outside = case_when(!is.na(outside_1) ~ outside_1,
                                    !is.na(outside_2) ~ outside_2)) |>
  dplyr::select(-contains("outside_")) |>
  dplyr::mutate(please = case_when(!is.na(please_1) ~ please_1,
                                   !is.na(please_2) ~ please_2)) |>
  dplyr::select(-contains("please_")) |>
  dplyr::mutate(telephone = case_when(!is.na(telephone) ~ telephone,
                                      !is.na(telelphone) ~ telelphone)) |>
  dplyr::select(-telelphone) |>
  tidyr::pivot_longer(cols = !(play_id | site_id | subject_number),
                        names_to = "word",
                        values_to = "understands_or_says")

xtabs(~ word + understands_or_says, eng_12_long)
                understands_or_says
word             understands understands_says
  a                        8                0
  airplane                26                0
  allgone                 85               11
  also                     3                0
  animal                  19                0
  apple                    2                0
  arms                    33                0
  away                     8                0
  baabaa                  15               20
  baby                    84                9
  babysitter               3                0
  ball                    89               25
  balloon                 30                7
  banana                   2                0
  bath                   109                7
  be                       1                0
  bear                    24                5
  bed                     58                1
  beepbeep                 0                0
  bellybutton              2                0
  bib                     60                0
  bicycle                 17                1
  big                     22                2
  bird                    32                0
  bite                    46                1
  blanket                 37                1
  blow                    29                0
  book                   101               17
  boots                    5                0
  bottle                  78               36
  box                     26                1
  boy                     14                0
  bread                   19                0
  break                    2                0
  broken                   4                0
  broom                   11                1
  brother                 24                8
  brush                   36                1
  bunny                   34                0
  button                  11                1
  bye                     91               57
  cake                    10                1
  candy                    3                0
  car                     59                7
  cat                     49               17
  cereal                  11                1
  chair                   29                0
  cheese                   1                0
  chicken                 24                1
  choo_choo               12                4
  church                   9                0
  clockwatch              17                1
  close                   47                0
  cockadoodledoo          11                2
  comb                    14                0
  cookie                  18                3
  couch                   32                0
  cow                     29                5
  crib                     3                0
  cry                     42                0
  cup                     59                4
  daddy                   38              110
  dance                   80                0
  dark                     9                0
  diaper                  89                3
  dirty                   26                1
  dish                     3                0
  dog                     66               34
  doll                    26                1
  dont                    62                2
  door                    42                2
  draw                     8                0
  drawer                   2                0
  dress                   13                0
  drum                    31                0
  duck                    33                4
  ears                     0                0
  eat                    109                4
  egg                     45                2
  elephant                35                0
  eye                     37                3
  face                     1                0
  fall                    20                0
  family                  19                0
  fast                    15                0
  feed                    25                0
  finger                  37                0
  finish                  23                4
  firetruck               17                0
  flower                  25                0
  foot                    55                0
  for                      4                0
  frog                    22                0
  girl                    11                0
  give                     1                0
  glass                    2                0
  glasses                 38                2
  go                      46                7
  goodmorning             68                0
  grandma                 73               15
  grandpa                 62               16
  hair                    53                1
  hammer                   4                0
  hand                    56                0
  hat                     30                4
  have                    16                1
  head                    43                0
  help                    37                1
  here                    34                1
  hi                      82               62
  hisher                   8                0
  hit                     29                0
  home                    46                0
  horse                   23                0
  hot                     48                4
  how                      0                0
  hurry                    2                0
  hurt                    24                1
  I                       12                1
  icecream                17                0
  in                      59                2
  juice                    4                0
  jump                    26                0
  keys                    38                0
  kick                    22                1
  kiss                    98                1
  kitchen                 31                0
  kitty                   52               13
  lady                     4                0
  lamp                     6                0
  leg                     21                0
  light                   41                5
  lion                    23                1
  look                    77                1
  man                      2                1
  many                     6                0
  me                      16                2
  meat                    10                0
  medicine                19                0
  meow                    43               13
  milk                    93               12
  mine                    27                0
  mommy                   52               99
  money                    4                0
  monkey                  33                0
  moo                      1                0
  moon                    11                2
  more                    73               20
  mouse                    9                0
  mouth                   53                3
  nap                      3                0
  necklace                10                0
  new                      2                0
  night                   33                3
  nightnight              69                9
  none                    12                0
  nose                    52                3
  now                     13                0
  on                      41                3
  onetwothree             39                1
  open                    69                0
  other                    3                0
  ouch                    48                5
  out                     35                1
  outside                 80                0
  pajamas                 42                0
  pants                   33                1
  paper                   17                0
  party                    8                0
  pattycake               45                0
  pen                     14                0
  penguin                 11                0
  picture                 34                0
  pillow                  25                0
  plant                   16                0
  play                    66                1
  please                  32                2
  pretty                  11                1
  purse                    7                0
  push                    34                0
  put                     61                0
  quackquack              21               14
  radio                    1                0
  rain                    10                0
  refrigerator            25                0
  rock                    12                1
  say                     21                0
  scissors                 1                0
  see                     46                0
  shh                     76               10
  shirt                    3                0
  shoe                    59                2
  sing                    30                0
  sink                    12                0
  sister                  19                2
  sit                     61                0
  sky                     22                0
  sleep                   71                0
  smile                   49                1
  soap                    19                0
  sock                    51                3
  soft                    34                0
  some                     5                0
  spoon                   57                0
  squirrel                18                0
  stairs                  50                0
  stop                     4                0
  store                   13                0
  street                   8                0
  stroller                41                0
  sun                     21                1
  swing                    1                0
  table                   27                0
  take                    27                0
  teddybear               30                3
  telephone               48                0
  television              23                0
  thankyou                56                9
  them                     3                0
  there                   26                1
  this                    22                5
  throw                   52                0
  tickle                  49                2
  tiger                   15                2
  tired                   57                0
  toast                    6                0
  today                    4                0
  tomorrow                 3                0
  tongue                  31                0
  tooth                   29                1
  touch                   48                0
  towel                   26                1
  toy                     83                0
  train                   20                1
  trash                   25                1
  tree                    31                5
  truck                   41                2
  turtle                  17                2
  uh_oh                   69               34
  uhoh                     7                2
  vroom                   19               25
  wait                    50                0
  walk                    65                0
  want                    34                0
  wash                    30                0
  water                   95               13
  where                   57                1
  who                     20                1
  window                  34                0
  woofwoof                51               26
  write                    2                0
  yes                     83               13
  yumyum                  65               19
Code
word_ct <- eng_12_long |>
  dplyr::filter(!is.na(understands_or_says)) |>
  dplyr::filter(understands_or_says == "understands") |>
  dplyr::count(word, sort = TRUE)

xtabs(~ word + understands_or_says, eng_12_long)
                understands_or_says
word             understands understands_says
  a                        8                0
  airplane                26                0
  allgone                 85               11
  also                     3                0
  animal                  19                0
  apple                    2                0
  arms                    33                0
  away                     8                0
  baabaa                  15               20
  baby                    84                9
  babysitter               3                0
  ball                    89               25
  balloon                 30                7
  banana                   2                0
  bath                   109                7
  be                       1                0
  bear                    24                5
  bed                     58                1
  beepbeep                 0                0
  bellybutton              2                0
  bib                     60                0
  bicycle                 17                1
  big                     22                2
  bird                    32                0
  bite                    46                1
  blanket                 37                1
  blow                    29                0
  book                   101               17
  boots                    5                0
  bottle                  78               36
  box                     26                1
  boy                     14                0
  bread                   19                0
  break                    2                0
  broken                   4                0
  broom                   11                1
  brother                 24                8
  brush                   36                1
  bunny                   34                0
  button                  11                1
  bye                     91               57
  cake                    10                1
  candy                    3                0
  car                     59                7
  cat                     49               17
  cereal                  11                1
  chair                   29                0
  cheese                   1                0
  chicken                 24                1
  choo_choo               12                4
  church                   9                0
  clockwatch              17                1
  close                   47                0
  cockadoodledoo          11                2
  comb                    14                0
  cookie                  18                3
  couch                   32                0
  cow                     29                5
  crib                     3                0
  cry                     42                0
  cup                     59                4
  daddy                   38              110
  dance                   80                0
  dark                     9                0
  diaper                  89                3
  dirty                   26                1
  dish                     3                0
  dog                     66               34
  doll                    26                1
  dont                    62                2
  door                    42                2
  draw                     8                0
  drawer                   2                0
  dress                   13                0
  drum                    31                0
  duck                    33                4
  ears                     0                0
  eat                    109                4
  egg                     45                2
  elephant                35                0
  eye                     37                3
  face                     1                0
  fall                    20                0
  family                  19                0
  fast                    15                0
  feed                    25                0
  finger                  37                0
  finish                  23                4
  firetruck               17                0
  flower                  25                0
  foot                    55                0
  for                      4                0
  frog                    22                0
  girl                    11                0
  give                     1                0
  glass                    2                0
  glasses                 38                2
  go                      46                7
  goodmorning             68                0
  grandma                 73               15
  grandpa                 62               16
  hair                    53                1
  hammer                   4                0
  hand                    56                0
  hat                     30                4
  have                    16                1
  head                    43                0
  help                    37                1
  here                    34                1
  hi                      82               62
  hisher                   8                0
  hit                     29                0
  home                    46                0
  horse                   23                0
  hot                     48                4
  how                      0                0
  hurry                    2                0
  hurt                    24                1
  I                       12                1
  icecream                17                0
  in                      59                2
  juice                    4                0
  jump                    26                0
  keys                    38                0
  kick                    22                1
  kiss                    98                1
  kitchen                 31                0
  kitty                   52               13
  lady                     4                0
  lamp                     6                0
  leg                     21                0
  light                   41                5
  lion                    23                1
  look                    77                1
  man                      2                1
  many                     6                0
  me                      16                2
  meat                    10                0
  medicine                19                0
  meow                    43               13
  milk                    93               12
  mine                    27                0
  mommy                   52               99
  money                    4                0
  monkey                  33                0
  moo                      1                0
  moon                    11                2
  more                    73               20
  mouse                    9                0
  mouth                   53                3
  nap                      3                0
  necklace                10                0
  new                      2                0
  night                   33                3
  nightnight              69                9
  none                    12                0
  nose                    52                3
  now                     13                0
  on                      41                3
  onetwothree             39                1
  open                    69                0
  other                    3                0
  ouch                    48                5
  out                     35                1
  outside                 80                0
  pajamas                 42                0
  pants                   33                1
  paper                   17                0
  party                    8                0
  pattycake               45                0
  pen                     14                0
  penguin                 11                0
  picture                 34                0
  pillow                  25                0
  plant                   16                0
  play                    66                1
  please                  32                2
  pretty                  11                1
  purse                    7                0
  push                    34                0
  put                     61                0
  quackquack              21               14
  radio                    1                0
  rain                    10                0
  refrigerator            25                0
  rock                    12                1
  say                     21                0
  scissors                 1                0
  see                     46                0
  shh                     76               10
  shirt                    3                0
  shoe                    59                2
  sing                    30                0
  sink                    12                0
  sister                  19                2
  sit                     61                0
  sky                     22                0
  sleep                   71                0
  smile                   49                1
  soap                    19                0
  sock                    51                3
  soft                    34                0
  some                     5                0
  spoon                   57                0
  squirrel                18                0
  stairs                  50                0
  stop                     4                0
  store                   13                0
  street                   8                0
  stroller                41                0
  sun                     21                1
  swing                    1                0
  table                   27                0
  take                    27                0
  teddybear               30                3
  telephone               48                0
  television              23                0
  thankyou                56                9
  them                     3                0
  there                   26                1
  this                    22                5
  throw                   52                0
  tickle                  49                2
  tiger                   15                2
  tired                   57                0
  toast                    6                0
  today                    4                0
  tomorrow                 3                0
  tongue                  31                0
  tooth                   29                1
  touch                   48                0
  towel                   26                1
  toy                     83                0
  train                   20                1
  trash                   25                1
  tree                    31                5
  truck                   41                2
  turtle                  17                2
  uh_oh                   69               34
  uhoh                     7                2
  vroom                   19               25
  wait                    50                0
  walk                    65                0
  want                    34                0
  wash                    30                0
  water                   95               13
  where                   57                1
  who                     20                1
  window                  34                0
  woofwoof                51               26
  write                    2                0
  yes                     83               13
  yumyum                  65               19
Code
# rcb_color_paired <- RColorBrewer::brewer.pal(12, 'Paired')
# wordcloud::wordcloud(words = word_ct$word, freq = word_ct$n, min.freq = quant_25, colors = rcb_color_paired)

mcdi_viz_wordcloud(word_ct, n_participants = dim(eng_12)[1], quantile = .50)

18-mo-old English speakers

Code
eng_18 <-
  readr::read_csv(
    file.path(here::here(), "data/csv/home_visit/agg/mcdi_english_18_combined.csv"),
    col_types = readr::cols(.default = 'c'),
    show_col_types = FALSE
  )
Code
word_ct <- eng_18 |>
  dplyr::mutate(wet = case_when(!is.na(wet_1) ~ wet_1,
                                !is.na(wet_2) ~ wet_2)) |>
  dplyr::select(-contains("wet_")) |>
  dplyr::mutate(rain = case_when(!is.na(rain_1) ~ rain_1,
                                !is.na(rain_2) ~ rain_2,
                                !is.na(rain_3) ~ rain_3)) |>
  dplyr::select(-contains("rain_")) |>
  dplyr::mutate(leg = case_when(!is.na(leg_1) ~ leg_1,
                                !is.na(leg_2) ~ leg_2)) |>
  dplyr::rename(candy = candy_1) |>
  tidyr::pivot_longer(cols = !(play_id | site_id | subject_number),
                        names_to = "word",
                        values_to = "says") |>
  dplyr::filter(!is.na(says)) |>
  dplyr::filter(says == TRUE) |>
  dplyr::count(word, sort = TRUE)

word_ct
# A tibble: 354 × 2
   word         n
   <chr>    <int>
 1 daddy      136
 2 mommy      133
 3 bye        127
 4 uhoh       122
 5 ball       118
 6 hi         118
 7 no         117
 8 banana     106
 9 woofwoof   106
10 yes        100
# ℹ 344 more rows
Code
#wordcloud::wordcloud(words = word_ct$word, freq = word_ct$n, min.freq = quant_25, colors = rcb_color_paired)
mcdi_viz_wordcloud(word_ct, n_participants = dim(eng_18)[1], quantile = .50)
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : daddy could not be fit on page. It will not be plotted.

24-mo-old English speakers

Code
eng_24 <-
  readr::read_csv(
    file.path(here::here(), "data/csv/home_visit/agg/mcdi_english_24_combined.csv"),
    col_types = readr::cols(.default = 'c'),
    show_col_types = FALSE
  )
Code
word_ct <- eng_24 |>
  tidyr::pivot_longer(cols = !(play_id | site_id | subject_number),
                        names_to = "word",
                        values_to = "says") |>
  dplyr::filter(!is.na(says)) |>
  dplyr::filter(says == TRUE) |>
  dplyr::count(word, sort = TRUE)
Code
mcdi_viz_wordcloud(word_ct, n_participants = dim(eng_24)[1], quantile = .50)
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : quackquack could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : baby could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : more could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : bathtub could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : thankyou could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : truck could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : bear could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : butterfly could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : woofwoof could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : box could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : swing could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : kiss could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : wash could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : star could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : icecream could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : couch could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : here could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : letsgo could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : two could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : soap could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : choochoo could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : house could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : toothbrush could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : towel could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : four could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : yumyum could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : chair could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : cup could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : frog could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : drink could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : telephone could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : blanket could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : open could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : mommy could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : balloon could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : knee could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : book could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : meow could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : help could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : strawberry could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : yucky could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : shoe could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : eat could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : ear could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : rain_2 could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : bellybutton could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : monkey could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : jump could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : banana could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : moon could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : this could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : keys could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : ball could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : dirty could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : head could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : yes could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : trash could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : five could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : juice could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : bye could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : airplane could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : bed could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : cold could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : shh could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : out could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : cake could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : baabaa could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : spoon could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : brush could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : yogurt could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : tummy could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : hot could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : eye could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : cookie could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : mouth could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : paper could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : dog could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : hug could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : leg_1 could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : cat could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : see could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : dance could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : cow could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : grapes could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : hat could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : buttocks could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : down could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : six could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : run could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : inside could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : no could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : lion could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : go could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : bug could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : flower could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : where could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : duck could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : sleep could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : walk could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : nightnight could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : rock could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : look could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : cracker could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : sock could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : vroom could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : please could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : orange could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : plate could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : egg could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : face could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : mine could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : bottle could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : pants could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : ouch could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : wet_1 could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : fast could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : one could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : happy could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : daddy could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : apple could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : milk could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : foot could not be fit on page. It will not be plotted.

Here are some rare words (quantile < 0.20).

Code
rare_word_ct <- word_ct |>
  dplyr::filter(n < dim(eng_24)[1]*.25)
# 
# wordcloud::wordcloud(words = rare_word_ct$word, freq = rare_word_ct$n)
mcdi_viz_wordcloud(rare_word_ct, n_participants = dim(eng_24)[1], quantile = .20)
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : person could not be fit on page. It will not be plotted.
Warning in wordcloud::wordcloud(words = wd_ct$word, freq = wd_ct$n, min.freq =
my_thresh, : penis could not be fit on page. It will not be plotted.

Locomotion

Check for anomalous values

Code
crawl_mos_min <- 4
walk_mos_min <- 6

Anomalous crawling onset

Code
hv |>
  dplyr::select(site_id, participant_ID, crawl_mos) |>
  dplyr::filter(crawl_mos < crawl_mos_min) |>
  kableExtra::kable(format = 'html') |>
  kableExtra::kable_classic()
site_id participant_ID crawl_mos
CHOPH 003 3.72
PRINU 020 -5.69

Anomalous walking onset (KEA criteria)

Code
hv |>
  dplyr::select(site_id, participant_ID, walk_mos_kea) |>
  dplyr::filter(walk_mos_kea < walk_mos_min) |>
  kableExtra::kable(format = 'html') |>
  kableExtra::kable_classic()
site_id participant_ID walk_mos_kea
CSUFL 011 0.76
UMIAM 018 2.76
PRINU 020 -2.93

Anomalous walking onset (WHO criteria)

Code
hv |>
  dplyr::select(site_id, participant_ID, walk_mos_who) |>
  dplyr::filter(walk_mos_who < walk_mos_min) |>
  kableExtra::kable(format = 'html') |>
  kableExtra::kable_classic()
site_id participant_ID walk_mos_who
PRINU 020 -3.29

Crawl onset

Code
hv |>
  dplyr::filter(crawl_mos > crawl_mos_min, !is.na(crawl_mos)) |>
  ggplot() +
  aes(crawl_mos, fill = child_sex) +
  geom_histogram(bins = 12) +
  theme(legend.position = "bottom") +
  theme(legend.title = element_blank())
Figure 10.3: Age of crawling onset (mos) by sex

Walk onset

Code
hv |>
  dplyr::filter(walk_mos_kea > walk_mos_min, !is.na(walk_mos_kea)) |>
  ggplot() +
  aes(walk_mos_kea, fill = child_sex) +
  theme(legend.position="bottom") +
  geom_histogram(bins = 10)

message("Tukey's five number summary (minimum, lower-hinge, median, upper-hinge, maximum): ")
Tukey's five number summary (minimum, lower-hinge, median, upper-hinge, maximum): 
Code
hv$walk_mos_kea |> fivenum()
[1] -2.93 11.70 12.72 14.27 19.00
Figure 10.4: Age (mos) of walking onset (KEA criteria) by sex
Code
hv |>
  dplyr::filter(walk_mos_who > walk_mos_min, !is.na(walk_mos_who)) |>
  ggplot() +
  aes(walk_mos_who, fill = child_sex) +
  geom_histogram(bins=12) +
  theme(legend.position="bottom") +
  theme(legend.title = element_blank())

message("Tukey's five number summary (minimum, lower-hinge, median, upper-hinge, maximum): ")
Tukey's five number summary (minimum, lower-hinge, median, upper-hinge, maximum): 
Code
hv$walk_mos_who |> fivenum()
[1] -3.29 11.11 12.13 13.58 25.08
Figure 10.5: Age (mos) of walking onset (WHO criteria) by sex
Code
filtered_walk_mos <- hv |>
  dplyr::filter(walk_mos_who > walk_mos_min, !is.na(walk_mos_who), 
                walk_mos_kea > walk_mos_min, !is.na(walk_mos_kea)) 

filtered_walk_mos |>
  ggplot() +
  aes(walk_mos_who, walk_mos_kea, color = child_sex) +
  geom_point() +
  geom_smooth(method = "lm") +
  xlim(8, 18) +
  ylim(8, 18) +
  theme(legend.position = "bottom") +
  theme(aspect.ratio = 1) +
  theme(legend.title = element_blank()) -> walk_p

ggExtra::ggMarginal(
  walk_p,
  play_loco,
  walk_mos_who,
  walk_mos_kea,
  type = "density",
  margins = "both",
  groupColour = TRUE,
  groupFill = TRUE
)
`geom_smooth()` using formula = 'y ~ x'
Warning: Removed 9 rows containing non-finite outside the scale range
(`stat_smooth()`).
`geom_smooth()` using formula = 'y ~ x'
Warning: Removed 9 rows containing non-finite outside the scale range
(`stat_smooth()`).
Warning: Removed 9 rows containing missing values or values outside the scale range
(`geom_point()`).
Warning: Removed 1 row containing missing values or values outside the scale range
(`geom_smooth()`).
Code
cor.test(filtered_walk_mos$walk_mos_who, filtered_walk_mos$walk_mos_kea)

    Pearson's product-moment correlation

data:  filtered_walk_mos$walk_mos_who and filtered_walk_mos$walk_mos_kea
t = 55.876, df = 648, p-value < 2.2e-16
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
 0.8958008 0.9223662
sample estimates:
     cor 
0.910013 
Figure 10.6: Walking onset by WHO vs. KEA criteria
Code
filtered_walk_crawl_mos <- hv |>
  dplyr::filter(crawl_mos > crawl_mos_min, !is.na(crawl_mos), 
                walk_mos_kea > walk_mos_min, !is.na(walk_mos_kea))

filtered_walk_crawl_mos |>
  ggplot() +
  aes(crawl_mos, walk_mos_kea, color = child_sex) +
  geom_point() +
  geom_smooth(method = "lm") +
  theme(legend.position = "bottom") +
  theme(aspect.ratio = 1) +
  theme(legend.title = element_blank()) -> walk_crawl_p

ggExtra::ggMarginal(
  walk_crawl_p,
  filtered_walk_crawl_mos,
  crawl_mos,
  walk_mos_kea,
  type = "density",
  margins = "both",
  groupColour = TRUE,
  groupFill = TRUE
)
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'
Code
cor.test(filtered_walk_crawl_mos$crawl_mos, filtered_walk_crawl_mos$walk_mos_kea)

    Pearson's product-moment correlation

data:  filtered_walk_crawl_mos$crawl_mos and filtered_walk_crawl_mos$walk_mos_kea
t = 15.211, df = 616, p-value < 2.2e-16
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
 0.4627415 0.5776048
sample estimates:
    cor 
0.52254 
Figure 10.7: Walking onset vs. Crawling

Health

Feeding

Code
xtabs(formula = ~ age_group + feeding_breastfeed, data = hv)
Table 10.1: Breastfeeding by age group
         feeding_breastfeed
age_group donotknow  no refused yes
     12mo         0  16       0 290
     18mo         1  15       0 292
     24mo         0  12       1 231
Code
hv %>%
  dplyr::select(child_sex, feeding_solidfood_age) |>
  dplyr::filter(feeding_solidfood_age < 12) |>
  ggplot() +
  aes(x = feeding_solidfood_age, color = child_sex, fill = child_sex) +
  geom_histogram(bins = 6) +
  xlab("Introduction of solid foods (mos)") +
  theme(legend.title = element_blank())
Figure 10.8: Age at introduction of solid foods

There are some unlikely values here.

Code
hv |>
  dplyr::select(participant_ID, 
                feeding_solidfood_age) |>
  dplyr::filter(feeding_solidfood_age > 12 | feeding_solidfood_age < 3) %>%
  knitr::kable(format = 'html')
participant_ID feeding_solidfood_age
996 999
006 990
012 990
031 995
001 0
Warning

A preliminary look at feeding_comments shows that there are some names mentioned. So, we do not view them here.

We should consider flagging these in the QA process.

Sleeping position

These data only focus on child_sleeping_position. Other sleeping data are in the screening questionnaire.

Code
xtabs(formula = ~ child_sleeping_position + age_group, data = hv)
Table 10.2: Child sleeping position by age group
                       age_group
child_sleeping_position 12mo 18mo 24mo
           back          281  293  227
           changed         4    3    3
           donotknow       0    1    0
           other           4    1    1
           refused         0    0    1
           side            5    3    6
           sitting         2    0    1
           stomach_down    1    1    2
           stomach_side    9    6    3

Child health

Overall rating

Code
child_health_rating <- hv |>
  # dplyr::select(child_sex, age_group, child_health) |>
  dplyr::filter(!is.na(child_health)) |>
  dplyr::mutate(child_health = factor(child_health,
                                      c("poor",
                                        "fair",
                                        "good",
                                        "verygood",
                                        "excellent",
                                        "donotknow",
                                        "refused"),
                                      ordered = TRUE))

xtabs(formula = ~ child_health + age_group, data = child_health_rating)
Table 10.3: Parent-report of overall child health
            age_group
child_health 12mo 18mo 24mo
   poor         0    0    0
   fair         2    2    1
   good        13   19   16
   verygood    79   71   64
   excellent  212  215  162
   donotknow    0    1    0
   refused      0    0    1

Recent vaccination

Code
recent_vax <- hv |>
  dplyr::select(child_sex, age_group, child_recent_vaccination) |>
  dplyr::filter(!is.na(child_recent_vaccination))

xtabs(formula = ~ child_recent_vaccination + age_group, data = recent_vax)
Table 10.4
                        age_group
child_recent_vaccination 12mo 18mo 24mo
               donotknow    0    2    4
               no         169  211  190
               yes        137   95   50

Seen medical specialist

Code
seen_specialist <- hv |>
  dplyr::select(child_sex, age_group, child_medical_specialist) |>
  dplyr::filter(!is.na(child_medical_specialist))

xtabs(formula = ~ child_medical_specialist + age_group, data = seen_specialist)
Table 10.5: Children who have seen a medical specialist
                        age_group
child_medical_specialist 12mo 18mo 24mo
               donotknow    0    1    2
               no         157  135  109
               refused      0    0    1
               yes        149  172  132
Warning

Manual inspection shows some possible identifying information (names) in child_medical_specialist_comments.

Hearing tested

Code
hearing_tested <- hv |>
  dplyr::select(child_sex, age_group, child_hearing_tested) |>
  dplyr::filter(!is.na(child_hearing_tested))

xtabs(formula = ~ child_hearing_tested + age_group, data = hearing_tested)
Table 10.6: Hearing test and context
                         age_group
child_hearing_tested      12mo 18mo 24mo
  afterhome                  7   18   12
  birthhospital            249  229  169
  birthhospital afterhome   39   49   46
  birthhospital donotknow    1    1    1
  donotknow                  1    5    6
  no                         9    6    9
  refused                    0    0    1

Vision tested

Code
vision_tested <- hv |>
  dplyr::select(child_sex, age_group, child_vision_tested) |>
  dplyr::filter(!is.na(child_vision_tested))

xtabs(formula = ~ child_vision_tested + age_group, data = vision_tested)
Table 10.7: Vision test and context
                         age_group
child_vision_tested       12mo 18mo 24mo
  afterhome                 48   57   51
  afterhome donotknow        0    1    0
  birthhospital             72   81   61
  birthhospital afterhome   29   33   30
  birthhospital donotknow    1    1    1
  donotknow                 39   42   28
  no                       116   91   70
  no donotknow               1    2    2
  refused                    0    0    1

Illnesses and allergies

Code
illness_allergy <- hv |>
  dplyr::select(child_sex, age_group, contains(c("allergies", "ear_infection", 
                                                 "asthma",
                                                 "respiratory",
                                                 "gastrointestinal")))

illness_allergy |>
  tidyr::pivot_longer(!c('child_sex', 'age_group'),
                      names_to = "type",
                      values_to = "response") |>
  dplyr::filter(!is.na(response)) |>
  dplyr::mutate(response = factor(response,
                                  c("no", "yes", "donotknow", "refused"))) |>
  ggplot() +
  aes(x = response, fill = child_sex) +
  geom_bar() +
  facet_grid(cols = vars(type), rows = vars(age_group)) +
  scale_x_discrete(guide = guide_axis(angle = 90)) +
  xlab("") +
  theme(legend.position = "bottom", legend.title = element_blank())
Figure 10.9: Parent reports of child illnesses or allergies.

Injuries

Code
xtabs(formula = ~ child_injury_times + age_group, data = hv)
Table 10.8: Child injuries
                  age_group
child_injury_times 12mo 18mo 24mo
         donotknow    1    2    1
         never      276  266  177
         once        23   31   56
         refused      0    0    1
         threemore    3    1    1
         twice        3    8    8

Mom health

Smoking & drinking

Code
smoking_drinking <- hv |>
  dplyr::select(age_group,
    child_sex,
    contains("smoking"),
    contains("drinking")
  )

xtabs(formula = ~ mom_pregnant_smoking + mom_pregnant_drinking, smoking_drinking)
Table 10.9: Smoking or drinking during pregancy
                    mom_pregnant_drinking
mom_pregnant_smoking donotknow  no refused yes
           donotknow         2   1       0   0
           no                0 712       1 135
           refused           0   0       1   0
           yes               0   1       0   2
Code
xtabs(formula = ~ smoking_house + smoking_car, smoking_drinking)
             smoking_car
smoking_house donotknow  no refused yes
    donotknow         1   1       0   0
    no                1 833       0   3
    refused           0   4       1   0
    yes               0  11       0   3
Warning

The following may contain identifiable data.

Table 10.10
Code
smoking_drinking |>
  dplyr::select(smoking_comments) |>
  dplyr::filter(!is.na(smoking_comments)) |>
  knitr::kable(format = 'html') |>
  kableExtra::kable_classic()
Code
xtabs(formula = ~ mom_smoking_now, smoking_drinking)
Table 10.11: Smoking currently
mom_smoking_now
donotknow        no   refused       yes 
        1       849         4         4 
Code
smoking_drinking$mom_smoking_now_amount[!is.na(smoking_drinking$mom_smoking_now_amount)]
Table 10.12: Amount if smoking currently
[1]  4  3  1 10
Warning

The following may contain identifiable data.

Table 10.13: Drinking comments
Code
smoking_drinking |>
  dplyr::select(mom_drinking_comments) |>
  dplyr::filter(!is.na(mom_drinking_comments)) |>
  knitr::kable(format = 'html') |>
  kableExtra::kable_classic()

Patient Health Questionnaire (PHQ-4)

Code
phq4 <- hv |>
  dplyr::select(child_sex, age_group, contains("phq4_")) |>
  dplyr::select(-contains("comments"))

names(phq4) <- gsub(pattern = "phq4_", replacement = "", names(phq4))

phq4 |>
  tidyr::pivot_longer(!c('child_sex', 'age_group'),
                      names_to = "question",
                      values_to = "response") |>
  dplyr::filter(!is.na(response)) |>
  dplyr::mutate(response = factor(
    response,
    c("notatall", "severaldays", "morethanhalf", "nearly")
  ), ordered = TRUE) |>
  ggplot() +
  aes(x = response, fill = child_sex) +
  geom_bar() +
  facet_grid(cols = vars(question), rows = vars(age_group)) +
  scale_x_discrete(guide = guide_axis(angle = 90)) +
  xlab("") +
  theme(legend.position = "bottom", legend.title = element_blank())
Figure 10.10: PHQ4 responses by age group and child sex

Rothbart ECBQ

The next section provides visualizations of the Rothbart Early Childhood Behavior Questionnaire (ECBQ) data related to child temperament.

Code
ecbq <- hv |>
  dplyr::select(child_sex, age_group, contains("ecbq"))

ecbq_complete <- ecbq |>
  tidyr::complete() |>
  dplyr::select(-ecbq_comments)

ecbq_vars <- names(ecbq)[stringr::str_detect(names(ecbq_complete),"ecbq_")]
# Drop comments
ecbq_vars <- ecbq_vars[!stringr::str_detect(ecbq_vars, "ecbq_comments")]

# Read questions CSV
ecbq_qs_all <- readr::read_csv(file = file.path(here::here(), "data/csv/_meta", "ecbq_questions.csv"), show_col_types = FALSE)

# Make questions data frame
ecbq_qs_df <- ecbq_qs_all |>
  dplyr::mutate(var_name = ecbq_vars)

Define helper functions.

Code
# Helper function to retrieve long question given short variable name
retrieve_long_q <- function(this_var= "rothbart_unfamiliarperson", data_dict = ecbq_qs_df) {
  assertthat::is.string(this_var)
  data_dict |>
    filter(var_name == this_var) |>
    select(question) |>
    as.character()
}

# Helper plot function
my_ecbq_plot <- function(var_lbl = "rothbart_unfamiliarperson", df) {
  stopifnot(is.data.frame(df))
  stopifnot(is.character(var_lbl))
  
  df <- df |> dplyr::select(child_sex, age_group, {{ var_lbl }})
  
  df <- df |>
    dplyr::filter(!is.na(.data[[var_lbl]])) |>
    dplyr::mutate(rating = factor(
      .data[[var_lbl]],
      c(
        "never",
        "very_rarely",
        "less_than_half",
        "about_half",
        "more_than_half",
        "almost_always",
        "always"
      ),
      ordered = TRUE
    ))
  
  ggplot(df) +
    aes(x = rating, fill = child_sex) +
    geom_bar() +
    facet_grid(cols = vars(age_group), rows = vars(child_sex)) +
    # https://stackoverflow.com/questions/1330989/rotating-and-spacing-axis-labels-in-ggplot2
    scale_x_discrete(guide = guide_axis(angle = 90)) +
    theme(legend.position = "none") +
    ggtitle(paste0("Ratings of '", {{var_lbl}}, "'")) +
    xlab("")
}

# Helper chunk function
return_section <- function(var, data) {
  chunk_hdr <- knitr::knit_expand(text = c("### Responses for: `{this_var}`", "\n"),
                                  this_var = var)
  
  # Build fig.cap from ground up
  fig_name <- paste0("fig-dist-", var)
  fig_cap <- paste0("'Distribution of responses to `", var, "`'")
  fig_caption <- paste0("fig.cap = ", fig_cap)
  
  plot_chunk_hdr <- paste0("```{r ",
                           fig_name,
                           ", echo = FALSE, warning = FALSE, ",
                           fig_caption,
                           "}")
  
  plot_chunk <- c(plot_chunk_hdr, "print(my_ecbq_plot(var, data))", "```")
  
  question_long <-
    paste0("\n**Q**: '", retrieve_long_q(var), "'", "\n")
  
  knitr::knit_child(
    text = c(chunk_hdr, question_long, plot_chunk),
    envir = environment(),
    quiet = TRUE
  )
}
Code
these_vars <- names(df)

res <- invisible(lapply(ecbq_vars, return_section, data = ecbq_complete))
cat(unlist(res), sep = "\n")

Responses for: ecbq_unfamiliarperson

Q: ‘When approached by an unfamiliar person in a public space (for example, the grocery store), how often did your child cling to a parent?’

Figure 10.11: Distribution of responses to ecbq_unfamiliarperson

Responses for: ecbq_troubletask

Q: ‘While having trouble completing a task (e.g. building, drawing, dressing), how often did your child get easily irritated?’

Figure 10.12: Distribution of responses to ecbq_troubletask

Responses for: ecbq_companyofchild

Q: ‘When a familiar child came to your home, how often did your child seek out the company of the child?’

Figure 10.13: Distribution of responses to ecbq_companyofchild

Responses for: ecbq_choiceactivities

Q: ‘When offered a choice of activities, how often did your child decide what to do very quickly and go for it?’

Figure 10.14: Distribution of responses to ecbq_choiceactivities

Responses for: ecbq_quietlysung

Q: ‘During daily or evening quiet time with you and your child, how often did your child enjoy just being quietly sung to?’

Figure 10.15: Distribution of responses to ecbq_quietlysung

Responses for: ecbq_playingoutdoors

Q: ‘While playing outdoors, how often did your child choose to take chances for the fun and excitement of it?’

Figure 10.16: Distribution of responses to ecbq_playingoutdoors

Responses for: ecbq_morethan10

Q: ‘While engaged in play with his/her favorite toy, how often did your child play for more than 10 minutes?’

Figure 10.17: Distribution of responses to ecbq_morethan10

Responses for: ecbq_respondingremarks

Q: ‘While engaged in play with his/her favorite toy, how often did your child continue to play while at the same time responding to your remarks or questions?’

Figure 10.18: Distribution of responses to ecbq_respondingremarks

Responses for: ecbq_excitedlovedadults

Q: ‘When told that loved adults would visit, how often did your child get very excited?’

Figure 10.19: Distribution of responses to ecbq_excitedlovedadults

Responses for: ecbq_fiddlehair

Q: ‘During quiet activities, such as reading a story, how often did your child fiddle with his/her hair, clothing, etc.?’

Figure 10.20: Distribution of responses to ecbq_fiddlehair

Responses for: ecbq_roughrowdy

Q: ‘While playing indoors, how often did your child like rough and rowdy games?’

Figure 10.21: Distribution of responses to ecbq_roughrowdy

Responses for: ecbq_rockedhugged

Q: ‘When being gently rocked or hugged, how often did your child seem eager to get away?’

Figure 10.22: Distribution of responses to ecbq_rockedhugged

Responses for: ecbq_involvednewactivity

Q: ‘When encountering a new activity, how often did your child get involved immediately?’

Figure 10.23: Distribution of responses to ecbq_involvednewactivity

Responses for: ecbq_tirequickly

Q: ‘When engaged in an activity requiring attention, such as building with blocks, how often did your child tire of the activity relatively quickly?’

Figure 10.24: Distribution of responses to ecbq_tirequickly

Responses for: ecbq_callattention

Q: ‘During everyday activities, how often did your child pay attention to you right away when you called to him/her?’

Figure 10.25: Distribution of responses to ecbq_callattention

Responses for: ecbq_tags

Q: ‘During everyday activities, how often did your child seem to be irritated by tags in his/her clothes?’

Figure 10.26: Distribution of responses to ecbq_tags

Responses for: ecbq_noisyenvironment

Q: ‘During everyday activities, how often did your child become bothered by sound while in a noisy environment?’

Figure 10.27: Distribution of responses to ecbq_noisyenvironment

Responses for: ecbq_energy

Q: ‘During everyday activities, how often did your child seem full of energy, even in the evening?’

Figure 10.28: Distribution of responses to ecbq_energy

Responses for: ecbq_vehicles

Q: ‘While in a public place, how often did your child seem afraid of large, noisy vehicles?’

Figure 10.29: Distribution of responses to ecbq_vehicles

Responses for: ecbq_active

Q: ‘When playing outdoors with other children, how often did your child seem to be one of the most active children?’

Figure 10.30: Distribution of responses to ecbq_active

Responses for: ecbq_forbidden

Q: ‘When told no, how often did your child stop the forbidden activity?’

Figure 10.31: Distribution of responses to ecbq_forbidden

Responses for: ecbq_sadlytearful

Q: ‘When told no, how often did your child become sadly tearful?’

Figure 10.32: Distribution of responses to ecbq_sadlytearful

Responses for: ecbq_downblue

Q: ‘Following an exciting activity or event, how often did your child seem to feel down or blue?’

Figure 10.33: Distribution of responses to ecbq_downblue

Responses for: ecbq_runhouse

Q: ‘When playing indoors, how often did your child run through the house?’

Figure 10.34: Distribution of responses to ecbq_runhouse

Responses for: ecbq_excitingevent

Q: ‘Before an exciting event (such as receiving a new toy), how often did your child get very excited about getting it?’

Figure 10.35: Distribution of responses to ecbq_excitingevent

Responses for: ecbq_tempertantrum

Q: ‘When he/she asked for something and you said no, how often did your child have a temper tantrum?’

Figure 10.36: Distribution of responses to ecbq_tempertantrum

Responses for: ecbq_waitpatiently

Q: ‘When asked to wait for a desirable item (such as ice cream), how often did your child wait patiently?’

Figure 10.37: Distribution of responses to ecbq_waitpatiently

Responses for: ecbq_rockedsmile

Q: ‘When being gently rocked, how often did your child smile?’

Figure 10.38: Distribution of responses to ecbq_rockedsmile

Responses for: ecbq_mold

Q: ‘While being held on your lap, how often did your child mold to your body?’

Figure 10.39: Distribution of responses to ecbq_mold

Responses for: ecbq_interactadult

Q: ‘When a familiar adult, such as a relative or a friend, visited your home, how often did your child want to interact with the adult?’

Figure 10.40: Distribution of responses to ecbq_interactadult

Responses for: ecbq_careful

Q: ‘When asked to do so, how often was your child able to be careful with something breakable?’

Figure 10.41: Distribution of responses to ecbq_careful

Responses for: ecbq_enternewplace

Q: ‘When visiting a new place, how often did your child not want to enter?’

Figure 10.42: Distribution of responses to ecbq_enternewplace

Responses for: ecbq_crymorethan3

Q: ‘When he/she was upset, how often did your child cry for more than 3 minutes, even when being comforted?’

Figure 10.43: Distribution of responses to ecbq_crymorethan3

Responses for: ecbq_easilysoothed

Q: ‘When he/she was upset, how often did your child become easily soothed?’

Figure 10.44: Distribution of responses to ecbq_easilysoothed

Responses for: ecbq_busyother

Q: ‘When you were busy, how often did your child find another activity to do when asked?’

Figure 10.45: Distribution of responses to ecbq_busyother

Responses for: ecbq_differentpeople

Q: ‘When around large gatherings of familiar adults or children, how often did your child enjoy playing with a number of different people?’

Figure 10.46: Distribution of responses to ecbq_differentpeople

Cross correlation

We make use of the ggcorrplot package for some simple visualizations of the ECBQ data.

Code
drop_rothbart_lbl <- function(x) {
  stringr::str_remove(x, "rothbart_")
}

make_ecbq_lvls_numeric <- function(x) {
  nas <- stringr::str_detect(x, "na")
  x[nas] <- NA
  x |>
    stringr::str_replace_all("never", "1") |>
    stringr::str_replace_all("very_rarely", "2") |>
    stringr::str_replace_all("less_than_half", "3") |>
    stringr::str_replace_all("about_half", "4") |>
    stringr::str_replace_all("more_than_half", "5") |>
    stringr::str_replace_all("almost_always", "6") |>
    stringr::str_replace_all("always", "7") |>
    as.numeric()
}

recode_ecbq_lvls <- function(df_col, df) {
  df |>
    dplyr::case_match(.data[[df_col]], "never" ~ 1,
                      "very_rarely" ~ 2,
                      "less_than_half" ~ 3,
                      "about_half" ~ 4,
                      "more_than_half" ~ 5,
                      "almost_always" ~ 6,
                      "always" ~ 7,
                      "na" ~ NA)
}

make_ecbq_lvls_nonNA <- function(x) {
  these_na_rows <- stringr::str_detect(x, "na")
  x[these_na_rows] <- NA
  x
}

clean_ecbq_var <- function(x) {
  x |> 
    make_ecbq_lvls_numeric() |>
    make_ecbq_lvls_nonNA() |>
    as.numeric()
}

ecbq_only <- ecbq_complete |>
  dplyr::select(-child_sex, -age_group) |>
  dplyr::rename_with(drop_rothbart_lbl)

make_numeric_ecbq <- function(var_lbl, df) {
  stopifnot(is.data.frame(df))
  stopifnot(is.character(var_lbl))
  
  df <- df |> 
    dplyr::select({{ var_lbl }})
  df
}

# ecbq_only <- ecbq_only |>
#   purrr::map(names(ecbq), make_rothbart_lvls_numeric)
  
# ecbq_corr <- round(cor(ecbq_only), 1)

Comments

Warning

Manual inspection shows that the comments field has some names. We omit printing the comments here until we can be assured that there is no identifiying information in the comments.

Code
ecbq |>
  dplyr::select(comments_rothbart) |>
  dplyr::filter(!is.na(comments_rothbart)) |>
  kableExtra::kable(format = 'html') |>
  kableExtra::kable_classic()

Media use

Home technology

Code
xtabs(formula = ~ mediause.home_technology.tv, hv)
Table 10.14: Use of TV at home
mediause.home_technology.tv
FALSE  TRUE 
   27   828 
Code
xtabs(formula = ~ mediause.home_technology.dvd, hv)
Table 10.15: Use of DVD at home
mediause.home_technology.dvd
FALSE  TRUE 
  567   288 
Code
xtabs(formula = ~ mediause.home_technology.computer, hv)
Table 10.16: Use of computer at home
mediause.home_technology.computer
FALSE  TRUE 
   33   822 
Code
xtabs(formula = ~ mediause.home_technology.ipad, hv)
Table 10.17: Use of iPad/tablet at home
mediause.home_technology.ipad
FALSE  TRUE 
  232   623 
Code
xtabs(formula = ~ mediause.home_technology.educationalgame, hv)
Table 10.18: Use of educational games at home
mediause.home_technology.educationalgame
FALSE  TRUE 
  660   195 
Code
xtabs(formula = ~ mediause.home_technology.videogame, hv)
Table 10.19: Use of video games at home
mediause.home_technology.videogame
FALSE  TRUE 
  353   502 

Child TV

Code
xtabs(formula = ~ mediause_technology_child_tv, hv)
Table 10.20: Use of TV by child
mediause_technology_child_tv
 no yes 
121 705 
Warning

The following may contain identifiable data.

Table 10.21
Code
hv |>
  dplyr::select(mediause_tv_how) |>
  dplyr::filter(!is.na(mediause_tv_how)) |>
  kableExtra::kable(format = 'html') |>
  kableExtra::kable_classic()

Child DVD

Code
xtabs(formula = ~ mediause_technology_child_dvd, hv)
Table 10.22: Use of DVD by child
mediause_technology_child_dvd
 no yes 
246  42 
Warning

The following may contain identifiable data.

Table 10.23
Code
hv |>
  dplyr::select(mediause_dvd_how) |>
  dplyr::filter(!is.na(mediause_dvd_how)) |>
  kableExtra::kable(format = 'html') |>
  kableExtra::kable_classic()

Child computer

Code
xtabs(formula = ~ mediause_technology_child_computer, hv)
Table 10.24: Use of computer by child
mediause_technology_child_computer
 no yes 
588 233 
Warning

The following may contain identifiable data.

Table 10.25
Code
hv |>
  dplyr::select(mediause_computer_how) |>
  dplyr::filter(!is.na(mediause_computer_how)) |>
  kableExtra::kable(format = 'html') |>
  kableExtra::kable_classic()

Child iPad

Code
xtabs(formula = ~ mediause_technology_child_ipad, hv)
Table 10.26: Use of iPad/tablet by child
mediause_technology_child_ipad
 no yes 
349 274 
Warning

The following may contain identifiable data.

Table 10.27
Code
hv |>
  dplyr::select(mediause_ipad_how) |>
  dplyr::filter(!is.na(mediause_ipad_how)) |>
  kableExtra::kable(format = 'html') |>
  kableExtra::kable_classic()

Child educational

Code
xtabs(formula = ~ mediause_technology_child_educational, hv)
Table 10.28: Use of educational games by child
mediause_technology_child_educational
 no yes 
 57 138 
Warning

The following may contain identifiable data.

Table 10.29
Code
hv |>
  dplyr::select(mediause_educational_how) |>
  dplyr::filter(!is.na(mediause_educational_how)) |>
  kableExtra::kable(format = 'html') |>
  kableExtra::kable_classic()

Child videogame

Code
xtabs(formula = ~ mediause_technology_child_videogame, hv)
Table 10.30: Use of video games by child
mediause_technology_child_videogame
 no yes 
433  69 
Warning

The following may contain identifiable data.

Table 10.31
Code
hv |>
  dplyr::select(mediause_videogame_how) |>
  dplyr::filter(!is.na(mediause_videogame_how)) |>
  kableExtra::kable(format = 'html') |>
  kableExtra::kable_classic()

TV hrs/day

Warning

The following may contain identifiable data.

Moreover, this is a free-text field that requires further processing to be visualized.

Table 10.32
Code
hv |>
  dplyr::select(mediause_tv_hrs_per_day) |>
  dplyr::filter(!is.na(mediause_tv_hrs_per_day)) |>
  kableExtra::kable(format = 'html') |>
  kableExtra::kable_classic()

Use meals

Code
xtabs(formula = ~ mediause_techuse_meals, hv)
Table 10.33: Use of technology at meals
mediause_techuse_meals
       likely       neutral   neverdothis notverylikely    verylikely 
          132           108           139           414            61 

Use playtime

Code
xtabs(formula = ~ mediause_techuse_playtime, hv)
Table 10.34: Use of technology at playtime
mediause_techuse_playtime
       likely       neutral   neverdothis notverylikely    verylikely 
          284           260            26           236            48 

Use bedtime

Code
xtabs(formula = ~ mediause_techuse_bedtime, hv)
Table 10.35: Use of technology at bedtime
mediause_techuse_bedtime
       likely       neutral   neverdothis notverylikely    verylikely 
           54            50           468           249            30 

Use transportation

Code
xtabs(formula = ~ mediause_techuse_transportation, hv)
Table 10.36: Use of technology during transportation
mediause_techuse_transportation
       likely       neutral   neverdothis notverylikely    verylikely 
          118            84           375           236            38 

Media use comments

Warning

The following may contain identifiable data.

Table 10.37
Code
hv |>
  dplyr::select(mediause_comments) |>
  dplyr::filter(!is.na(mediause_comments)) |>
  kableExtra::kable(format = 'html') |>
  kableExtra::kable_classic()

Pets

Code
xtabs(formula = ~ pets_at_home, hv)
Table 10.38: Pets at home
pets_at_home
 no yes 
305 551 
Code
hv$pets_types_number[!is.na(hv$pets_types_number)] |> head(20)
 [1] "1 dog"                                                                                                    
 [2] "1 cat"                                                                                                    
 [3] "1 Turtle"                                                                                                 
 [4] "2 dogs"                                                                                                   
 [5] "2 dogs"                                                                                                   
 [6] "2 pugs and 2 fish"                                                                                        
 [7] "1 cat"                                                                                                    
 [8] "2 Dogs"                                                                                                   
 [9] "1 dog"                                                                                                    
[10] "3 cats"                                                                                                   
[11] "2 Cats, 1 bearded dragon, 1 snake, 1 tarantula and 1 frog - (just had a fish but it recently passed away)"
[12] "2 cats"                                                                                                   
[13] "7 rabbits"                                                                                                
[14] "2 cats"                                                                                                   
[15] "1 dog"                                                                                                    
[16] "3 dogs"                                                                                                   
[17] "1 dog, 1 cat"                                                                                             
[18] "2 dogs"                                                                                                   
[19] "1 dog, 1 cat"                                                                                             
[20] "1 cat"                                                                                                    

These data need further cleaning to be visualized properly.

Code
hv_pets <- hv |>
  dplyr::mutate(dogs = stringr::str_detect(pets_types_number, "[dD]og"),
                cats = stringr::str_detect(pets_types_number, "[cC]at"))
Code
xtabs(formula = ~ dogs + cats, hv_pets)
Table 10.39: Dogs and/or cats
       cats
dogs    FALSE TRUE
  FALSE    21  148
  TRUE    295   86
Code
xtabs(formula = ~ pets_indoors_outdoors, hv)
Table 10.40: Pets indoors or out
pets_indoors_outdoors
 indoors outdoors 
     518       31 
Warning

There are some identifiable elements in the comments_pets field.

Table 10.41
Code
hv |>
  dplyr::select(comments_pets) |>
  dplyr::filter(!is.na(comments_pets)) |>
  knitr::kable(format = 'html') |>
  kableExtra::kable_classic()

Division of Labor

Code
div_labor_levels <- c(0:4)
div_labor_lbls <- c("never", "some_of_the_time", "about_half_the_time", "most_of_the_time", "all_of_the_time")
source("../R/div_labor_plot.R")

Laundry

Code
div_labor_plot("laundry_self", hv)
Figure 10.47: Laundry self
Code
div_labor_plot("laundry_partner", hv)
Figure 10.48: Laundry partner
Code
div_labor_plot("laundry_otherperson", hv)
Figure 10.49: Laundry other person
Code
div_labor_plot_by_person("laundry", hv)
Figure 10.50
Warning

There may be identifiable elements in the next field, so we do not render it.

Table 10.42
Code
hv |>
  dplyr::select(labor_laundry_otherperson) |>
  dplyr::filter(!is.na(labor_laundry_otherperson)) |>
  kableExtra::kable(format = 'html') |>
    kableExtra::kable_classic()

Cleaning

Code
div_labor_plot("cleaning_self", hv)
Figure 10.51: Cleaning self
Code
div_labor_plot("cleaning_partner", hv)
Figure 10.52: Cleaning partner
Code
div_labor_plot("cleaning_otherperson", hv)
Figure 10.53: Cleaning other person
Code
div_labor_plot_by_person("cleaning", hv)
Figure 10.54
Warning

There may be identifiable elements in the next field, so we do not render it.

Table 10.43
Code
hv |>
  dplyr::select(labor_cleaning_otherperson) |>
  dplyr::filter(!is.na(labor_cleaning_otherperson)) |>
  kableExtra::kable(format = 'html') |>
    kableExtra::kable_classic()

Dishes

Code
div_labor_plot("dishes_self", hv)
Figure 10.55: Dishes self
Code
div_labor_plot("dishes_partner", hv)
Figure 10.56: Dishes partner
Code
div_labor_plot("dishes_otherperson", hv)
Figure 10.57: Dishes other person
Code
div_labor_plot_by_person("dishes", hv)
Figure 10.58
Warning

There may be identifiable elements in the next field, so we do not render it.

Table 10.44
Code
hv |>
  dplyr::select(labor_dishes_otherperson) |>
  dplyr::filter(!is.na(labor_dishes_otherperson)) |>
  kableExtra::kable(format = 'html') |>
    kableExtra::kable_classic()

Cooking

Code
div_labor_plot("cooking_self", hv)
Figure 10.59: Cooking self
Code
div_labor_plot("cooking_partner", hv)
Figure 10.60: Cooking partner
Code
div_labor_plot("cooking_otherperson", hv)
Figure 10.61: Cooking other person
Code
div_labor_plot_by_person("cooking", hv)
Figure 10.62
Warning

There may be identifiable elements in the next field, so we do not render it.

Table 10.45
Code
hv |>
  dplyr::select(labor_cooking_otherperson) |>
  dplyr::filter(!is.na(labor_cooking_otherperson)) |>
  kableExtra::kable(format = 'html') |>
    kableExtra::kable_classic()

Feeding

Code
div_labor_plot("feeding_self", hv)
Figure 10.63: Feeding self
Code
div_labor_plot("feeding_partner", hv)
Figure 10.64: Feeding partner
Code
div_labor_plot("feeding_otherperson", hv)
Figure 10.65: Feeding other person
Warning

The call to div_labor_plot_by_person() fails with “feeding” because that string is found in other non-division-of-labor variables.

Code
div_labor_plot_by_person("feeding", hv)
Warning

There may be identifiable elements in the next field, so we do not render it.

Table 10.46
Code
hv |>
  dplyr::select(labor_feeding_otherperson) |>
  dplyr::filter(!is.na(labor_feeding_otherperson)) |>
  kableExtra::kable(format = 'html') |>
    kableExtra::kable_classic()

Drop-off/pick-up

Code
div_labor_plot("droppick_self", hv)
Figure 10.66: Drop-off/pick-up self
Code
div_labor_plot("droppick_partner", hv)
Figure 10.67: Drop-off/pick-up partner
Code
div_labor_plot("droppick_otherperson", hv)
Figure 10.68: Drop-off/pick-up other person
Code
div_labor_plot_by_person("droppick", hv)
Figure 10.69
Warning

There may be identifiable elements in the next field, so we do not render it.

Table 10.47
Code
div_labor_plot("dishes_self", hv)hv |>
  dplyr::select(labor_feeding_otherperson) |>
  dplyr::filter(!is.na(labor_feeding_otherperson)) |>
  kableExtra::kable(format = 'html') |>
    kableExtra::kable_classic()

Bedtime

Code
div_labor_plot("bed_self", hv)
Figure 10.70: Bed self
Code
div_labor_plot("bed_partner", hv)
Figure 10.71: Bed partner
Code
div_labor_plot("bed_otherperson", hv)
Figure 10.72: Bed other person
Code
div_labor_plot_by_person("bed", hv)
Figure 10.73
Warning

There may be identifiable elements in the next field, so we do not render it.

Table 10.48
Code
hv |>
  dplyr::select(labor_bed_otherperson) |>
  dplyr::filter(!is.na(labor_bed_otherperson)) |>
  kableExtra::kable(format = 'html') |>
    kableExtra::kable_classic()

Disciplining

Code
div_labor_plot("disciplining_self", hv)
Figure 10.74: Disciplining self
Code
div_labor_plot("disciplining_partner", hv)
Figure 10.75: Disciplining partner
Code
div_labor_plot("disciplining_otherperson", hv)
Figure 10.76: Disciplining other person
Code
div_labor_plot_by_person("disciplining", hv)
Figure 10.77
Warning

There may be identifiable elements in the next field, so we do not render it.

Table 10.49: Disciplining other person
Code
hv |>
  dplyr::select(labor_disciplining_otherperson) |>
  dplyr::filter(!is.na(labor_disciplining_otherperson)) |>
  kableExtra::kable(format = 'html') |>
    kableExtra::kable_classic()

Comments

Warning

There may be identifiable elements in the next field, so we do not render it.

Table 10.50
Code
hv |>
  dplyr::select(comments_division_labor) |>
  dplyr::filter(!is.na(comments_division_labor)) |>
  kableExtra::kable(format = 'html') |>
    kableExtra::kable_classic()

Typical day

Code
xtabs(formula = ~ typical_behavior, hv)
Table 10.51: Typical behavior
typical_behavior
 no yes 
101 752 
Warning

The following code will permit visualization of the comments, but the data should be checked for identifiable information before putting it in this document.

Table 10.52
Code
hv |>
  dplyr::select(typical_behavior_specifics) |>
  dplyr::filter(!is.na(typical_behavior_specifics)) |>
  knitr::kable(format = 'html') |>
  kableExtra::kable_classic()
Code
xtabs(formula = ~ typical_activities, hv)
Table 10.53: Typical activities
typical_activities
 no yes 
138 718 
Warning

The following code will permit visualization of the comments, but the data should be checked for identifiable information before putting it in this document.

Table 10.54
Code
hv |>
  dplyr::select(typical_activities_specifics) |>
  dplyr::filter(!is.na(typical_activities_specifics)) |>
  knitr::kable(format = 'html') |>
  kableExtra::kable_classic()
Code
xtabs(formula = ~ typical_nightmorning, hv)
Table 10.55: Typical night and morning
typical_nightmorning
 no yes 
207 647 
Warning

The following code will permit visualization of the comments, but the data should be checked for identifiable information before putting it in this document.

Table 10.56
Code
hv |>
  dplyr::select(typical_nightmorning_specifics) |>
  dplyr::filter(!is.na(typical_nightmorning_specifics)) |>
  knitr::kable(format = 'html') |>
  kableExtra::kable_classic()
Code
xtabs(formula = ~ typical_otherthanme, hv)
Table 10.57: Typical other than me
typical_otherthanme
 no yes 
115 741 
Warning

The following code will permit visualization of the comments, but the data should be checked for identifiable information before putting it in this document.

Table 10.58
Code
hv |>
  dplyr::select(typical_otherthanme_specifics) |>
  dplyr::filter(!is.na(typical_otherthanme_specifics)) |>
  knitr::kable(format = 'html') |>
  kableExtra::kable_classic()