# Running this code will take a while
# Two-group exact matching using the data set 'MAGMA_sim_data'
# Matching variable 'gifted_support' (received giftedness support yes or no)
# 'MAGMA_sim_data_gifted' contains the result of the matching
MAGMA_sim_data_gifted <- MAGMA(Data = MAGMA_sim_data,
group = "gifted_support",
dist = "ps_gifted",
cores = 1)
head(MAGMA_sim_data_gifted)
# \donttest{
# Two-group exact matching using the data set 'MAGMA_sim_data'
# Matching variable 'teacher_ability_rating' (ability rated from teacher as
# below average, average, or above average)
# MAGMA_sim_data_tar' contains the result of the matching
# Cores per default = 1
MAGMA_sim_data_tar <- MAGMA(Data = MAGMA_sim_data,
group = "teacher_ability_rating",
dist = "ps_tar")
head(MAGMA_sim_data_tar)
# 2x2 matching using the data set 'MAGMA_sim_data'
# Matching variables are 'gifted_support' (received giftedness support yes
# or no) and 'enrichment' (participated in enrichment or not)
# 'MAGMA_sim_data_gift_enrich' contains the result of the matching
# 2x2 matching is equal to four-group matching
MAGMA_sim_data_gift_enrich <- MAGMA(Data = MAGMA_sim_data,
group = c("gifted_support", "enrichment"),
dist = "ps_2x2",
cores = 2)
head(MAGMA_sim_data_gift_enrich)
# }
Run the code above in your browser using DataLab