From 61e86f2e90d72fb2baf989f8d2f8be66c27d0a7c Mon Sep 17 00:00:00 2001 From: gabrielcaser <91158283+gabrielcaser@users.noreply.github.com> Date: Tue, 9 Jul 2024 17:03:46 -0300 Subject: [PATCH] Update propensity_score_matching.md --- .../Matching/propensity_score_matching.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Model_Estimation/Matching/propensity_score_matching.md b/Model_Estimation/Matching/propensity_score_matching.md index f4233c7d..7c196e4d 100644 --- a/Model_Estimation/Matching/propensity_score_matching.md +++ b/Model_Estimation/Matching/propensity_score_matching.md @@ -127,15 +127,14 @@ match_data = match.data(match) #Check the dimensions. dim(match_data) -##Step Four: Conduct Analysis using the new sample. -##Turn marital status into a factor variable so that we can use it in our regression -match_data = match_data %>% mutate(marital_status = as.factor(marital_status)) +#Turn married into numeric variables +match_data = match_data %>% mutate(married = 1*(marital_status == "Married")) -##We can now get the treatment effect of smoking on gross income with and without controls +##We can now get the treatment effect of smoking on married status with and without controls # Note these standard errors will be incorrect, see Caliendo and Kopeinig (2008) for fixes # https://onlinelibrary.wiley.com/doi/full/10.1111/j.1467-6419.2007.00527.x -lm_nocontrols = lm(marital_status ~ smoke, data= match_data) +lm_nocontrols = lm(married ~ smoke, data= match_data) #With controls, standard errors also wrong here -lm_controls =lm(marital_status ~ smoke+age+gender+ethnicity+marital_status, data=match_data) +lm_controls =lm(married ~ smoke+age+gender+ethnicity, data=match_data) ```