Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Graphs after Kmatch

    I'm trying to replicate yearly graphs of the balance variables using Stata 18. I used Stata 17 last year and was able to get one graph for each year. My syntax is below

    global txvar mat
    global exact_vars_st lunch ethblk ethwht ethasian ethothr female ell swd lanothrengl grade9 grade10 grade10 grade11 grade12
    global match_vars_sch g8_zsci Manh Bronx Brooklyn Queens SI totreg per_ecdis per_black per_hisp per_asian per_white teacher_years_doe license_es license_gs

    kmatch md $txvar $match_vars_sch, over(year) ematch($exact_vars_st) ///
    nn(5) att wgen ebalance replace
    keep if _W_ATT > 0 & _W_ATT < .

    /**Here is where the graph commands start After it provides the balance ratios I get one graph and not one for each year**/

    kmatch summarize, skewness
    mat M = r(M)
    mat V = r(V)
    coefplot matrix(M[,3]) matrix(M[,6]) || matrix(V[,3]) matrix(V[,6]) || , ///
    bylabels("Std. mean difference" "Variance ratio") ///
    noci nolabels byopts(xrescale) ///
    legend(order(1 "Raw" 2 "Matched"))
    graph save "Graph" "S:\MAT\Year 10\Mat\Results\y2014_match.gph", replace
    graph save "Graph" "S:\MAT\Year 10\Mat\Results\y2015_match.gph", replace
    graph save "Graph" "S:\MAT\Year 10\Mat\Results\y2016_match.gph", replace
    graph save "Graph" "S:\MAT\Year 10\Mat\Results\y2017_match.gph", replace
    graph save "Graph" "S:\MAT\Year 10\Mat\Results\y2018_match.gph", replace
    graph save "Graph" "S:\MAT\Year 10\Mat\Results\y2019_match.gph", replace
    graph save "Graph" "S:\MAT\Year 10\Mat\Results\y2022_match.gph", replace
    graph save "Graph" "S:\MAT\Year 10\Mat\Results\y2023_match.gph", replace
Working...
X