Announcement

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

  • General Cluster Question

    Hi all,

    I am new to STATA so this is a very basic question. I want to do a probit regression with controls for gender and state and year fixed effects. I need to cluster at the state*year of census level.
    Would this look like:
    "probit y variableofinterest gender i.statecode i.yearcode, cluster(state*year)"
    Can you assist with this?
    This isn't working but I am not sure how to run this code exactly.
    Thanks!

  • #2
    Hi Lindsay
    The problem is that Stata does not understand what do you mean with Stata*Year, because it expects a single variable to be used there.
    What you can do is the following:
    Code:
    egen state_year=group(stata year)
    * or
    gen long state_year=year*1000+state
    * The second one assumes State is coded between 0 to 999.
    After that you can use the new variable as a cluster
    HTH

    Comment

    Working...
    X