Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update propensity_score_matching.md #212

Open
wants to merge 1 commit into
base: source
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions Model_Estimation/Matching/propensity_score_matching.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
```