Swap variable names: rename (v1 v2) (v2 v1) Lowercase (or uppercase, or propercase) groups of variable names: rename V1 V2, lower or rename *, lower Add suffix _old to variables…

# Stata

I ran a test on Stata running speed on my newest MacBook Pro (14-inch, 2021) and two old Macs—iMac (27-inch, 2019) and MacBook Pro (16-inch, 2019). Technical specifications: MacBook Pro…

Most propensity score matching (PSM) examples typically use cross-sectional data rather than panel data. However, in accounting research, panel data (observations with two subscripts i and t, e.g., firm-years) are…

A Chow test is simply a test of whether the coefficients estimated over one group of the data are equal to the coefficients estimated over another. I find two useful…

Stata is a case-sensitive application, which can sometimes cause trouble. Therefore, we might want to convert all variable names or the values of all string variables to lowercase before further…

tabulate varname command is handy in Stata, but sometimes it returns a too long result, if varname contains too many unique values. The third-party command, groups, will solve the problem…

Stata is a little bit awkward when using and and or in if statement, compared to SAS. For example: In SAS, we can write if 2001 <= fyear <= 2010….

Sometimes we may want to produce the following table to compare the mean and median of two groups: First of all, please refer to this post to see Stata commands…

We often see Heckman’s two steps in accounting literature. But how to do it in Stata? The two steps refer to the following two regressions: Outcome equation: y = X…

Please read this post for how to display the results in a ready-for-use format. UCLA IDRE has posted an article (link) that may provide a bit more explanation. UCLA IDRE is a…