I have a sample of banks. These vary across time, rating agency and across countries.

UPDATE: I trying to capture the effect of a regulatory change (dummy variable, 0/1) on a banks credit rating.

I am using monthly data and each bank has a set of characteristics that vary (e.g. size, profitability etc). There ends up being multiple instances for each bank in each period as a bank may be rated by more than one rating agency. Hence I define the data as follows:

//newID to make it 2d panel
egen newID = group(indexnumber moodys fitch)

//define panel
xtset newID edate1

My aim is to control for country and time effects using interacted country and year dummies. While controlling for bank heterogeneity by including a number of bank control variables.

How best would I go about doing this?

Should I:

  • Include country and year interacting dummies and cluster at bank level (current doing this)
  • Include bank and year dummies and cluster at a country level

Original post:

I was previously including country and year interacted fixed effects to control for variation across countries and years. I was also clustering at the bank level. e.g.

regress depVar indepVar i.country#i.year, vce(cluster bankID)

Having done some more research some people indicate it is best to cluster at the highest level (e.g. country). Then to run it with bank level fixed effects. e.g.

regress depVar indepVar i.bankID i.year, vce(cluster country)

I am worried that if I cluster like this, I wont control for changing country effects. I already include many control variables to control for variation on a bank level.

Would I be better using the built in xtreg in stata. If so will:

xtreg depVar indepVar, fe vce(cluster country)

be equivalent to:

regress depVar indepVar i.bankID i.year, vce(cluster country)
  • 1
    $\begingroup$ Welcome to Cross Validated. I'm curious about your question; what is the question that you are trying to answer? $\endgroup$
    – Candamir
    Commented Nov 7, 2018 at 17:02
  • $\begingroup$ Thanks, happy to be here!! Please see my update, I trying to capture the effect of a regulatory change on a banks credit rating, I know that using a diff-in-diff is optimal, but it isnt appropriate for my particular setting. $\endgroup$ Commented Nov 8, 2018 at 16:42

1 Answer 1


If your panel is set correctly (xtset bankID year), both of the last commands give you the same estimates. The standard errors will be however too high for OLS. Note that if you want to have both interactions and dummies, you'd need to specify country##year. (This may not work for old Stat versions)

  • $\begingroup$ please see my edits, my firm_ID is formed not just of the bank_id, but also used to differentiate between ratings from different agencies. That is why I was clustering using bank_id. So maybe xtset will give me different results because of that. Would it be best to include bank effects or country effects? $\endgroup$ Commented Nov 8, 2018 at 16:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.