Announcement

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

  • Writing a Loop structure in Stata for Matching study samples

    Hi Statalist,
    I am new to Stata. I have dataset containing two groups of firms; one group raised 1 type of equity whilst the other group group raised another type of equity. The raises of firms occurred in different years starting in 2011 through to 2018. I want to match these two groups of firms based on continuous variables a b and c but I want the matched firms to have raised equity in the same year. How do I go about? What is the syntax for such an operation? Thanks in advance

  • #2
    The following is from the help file for psmatch2 (Leuven and Sianesi, SSC):
    Code:
    Matching within strata
    
        The following code illustrates how to match within exact cells and then calculate the average effect for the whole
        population.
    
            g att = .
            egen g = group(groupvars)
            levels g, local(gr)
            qui foreach j of local gr {
                    psmatch2 treatvar varlist if g==`j', out(outvar)
                    replace att = r(att) if  g==`j'
            }
            sum att
    David Radwin
    Senior Researcher, California Competes
    californiacompetes.org
    Pronouns: He/Him

    Comment

    Working...
    X