Skip to contents

Treatment T_c = 1 iff Region_AtTimeOfPlacement != Region_MostRecent. Outcome Y_c = NumberConsecutiveDays_Segregation winsorised at the 99th percentile.

Usage

morie_otis_make_pair_c(df)

Arguments

df

OTIS placement-level data.frame.

Value

Named list list(data, T = "T_c", Y = "Y_c", covariates).

Examples

# \donttest{
# b01 (Segregation - Detailed Dataset) carries the full placement-level
# schema, including NumberConsecutiveDays_Segregation (see the bundled
# OTIS data dictionary).
df <- morie_datasets_otis_b01_segregation_detailed(offline = TRUE)
morie_otis_make_pair_c(df)
#> $data
#>   UniqueIndividual_ID EndFiscalYear Gender Age_Category
#> 1  2022-SYNTH-001-SEG          2022   Male     25 to 49
#> 2  2022-SYNTH-002-SEG          2022 Female     18 to 24
#> 3  2023-SYNTH-003-SEG          2023   Male     50 to 64
#> 4  2023-SYNTH-004-SEG          2023   Male     25 to 49
#> 5  2024-SYNTH-005-SEG          2024 Female     50 to 64
#>   Region_AtTimeOfPlacement Region_MostRecentPlacement MentalHealth_Alert
#> 1                  Toronto                    Toronto                Yes
#> 2                  Central                    Central                 No
#> 3                  Eastern                    Eastern                Yes
#> 4                  Western                    Western                 No
#> 5                 Northern                   Northern                Yes
#>   NumberConsecutiveDays_Segregation T_c   Y_c
#> 1                                 7   0  7.00
#> 2                                15   0 15.00
#> 3                                22   0 22.00
#> 4                                 5   0  5.00
#> 5                                30   0 29.68
#> 
#> $T
#> [1] "T_c"
#> 
#> $Y
#> [1] "Y_c"
#> 
#> $covariates
#> [1] "Gender"             "Age_Category"       "MentalHealth_Alert"
#> 
# }