Each group is estimated once with cdd() at the group's midpoint age with
the group's half-width as the age band, so the estimate is the group-
averaged effect. With align = "onset" groups are defined by age at the
onset of the shock and the target age advances with the wave, so that the
same cohorts are followed across waves (the dynamic profile); with
align = "interview" groups are defined by age at interview (the age profile).
Usage
cdd_groups(
data,
outcome,
onset,
wave = NULL,
waves = wave,
groups = data.frame(label = c("20-30", "30-44", "45-59", "60-74"), mid = c(25, 37, 52,
67), hw = c(5, 7, 7, 7)),
align = c("onset", "interview"),
...
)Arguments
- data
A data frame of repeated cross-sections.
- outcome
Name of the outcome column. Categorical outcomes are expanded into one linear probability equation per level unless
continuous = TRUE.- onset
Onset year of the shock. Pre-shock waves are those strictly before it.
- wave
The treated survey wave (year) whose respondents are the treated sample.
- waves
Vector of treated waves; defaults to
wave.- groups
A data frame with columns
label,mid,hw. The default gives four groups 20-30, 30-44, 45-59, 60-74.- align
"onset"or"interview".- ...
Further arguments passed to
cdd().
Value
A data frame with one row per group, wave, and level, with the
columns of a cdd object plus group, wave, onset, align.
Examples
data(gss_culture)
g <- cdd_groups(gss_culture, "homosex", onset = 1992, waves = c(1993, 1994), H = 5, levels = 1)
g[, c("group", "wave", "age", "ate", "se")]
#> group wave age ate se
#> 1 20-30 1993 26 -0.16830389 0.05876437
#> 2 30-44 1993 38 -0.09890071 0.04790715
#> 3 45-59 1993 53 -0.17410130 0.05150421
#> 4 60-74 1993 68 0.01845515 0.05488516
#> 5 20-30 1994 27 -0.15057133 0.05986370
#> 6 30-44 1994 39 -0.03406687 0.05153868
#> 7 45-59 1994 54 -0.12388297 0.05271578
#> 8 60-74 1994 69 -0.01828051 0.05742931