Categories
 Data (9)
 Learning Resources (9)
 Python (9)
 SAS (14)
 Stata (24)
 Uncategorized (1)

Recent Posts
Recent Comments
 Amy on Link FactSet and CRSP
 Kai Chen on Link FactSet and CRSP
 Amy on Link FactSet and CRSP
 Sylvia on Commonly used Stata commands to deal with potential outliers
 jianchen shi on Calculate delta (payperformance sensitivity), vega (risktaking incentives), and firmspecific wealth (inside equity) for executives on Execucomp
Archives
 February 2022
 January 2022
 August 2021
 March 2021
 September 2019
 August 2019
 July 2019
 May 2019
 April 2019
 March 2019
 August 2018
 July 2018
 December 2017
 November 2017
 October 2017
 September 2017
 April 2017
 September 2016
 April 2016
 December 2015
 November 2015
 September 2015
 August 2015
 June 2015
 March 2015
 February 2015
Meta
Category Archives: Stata
A test on Stata running speed on MacBook Pro (M1 Pro chip) and old Macs
I ran a test on Stata running speed on my newest MacBook Pro (14inch, 2021) and two old Macs—iMac (27inch, 2019) and MacBook Pro (16inch, 2019). Technical specifications: MacBook Pro (14inch, 2021): CPU Apple M1 Pro (10core), memory 16G, SSD … Continue reading
Posted in Stata
6 Comments
Use Stata to do propensity score matching (PSM)
Most propensity score matching (PSM) examples are using crosssectional data instead of panel data. However, accounting research often uses panel data (i.e., observations with two subscripts i and t, e.g. firmyears) in a differenceindifferences (DID) research design, so that there are … Continue reading
Posted in Stata
4 Comments
Stata command to perform Chow test
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 articles from Stata’s official website: Can you explain Chow tests? … Continue reading
Posted in Stata
5 Comments
Stata commands to change variable names or values of string variables to all lowercase
Stata is a casesensitive application. Sometimes this will cause a trouble. So, we may want to change variable names or values of variables to all lowercase before we start processing data. This post gives a fast way to do this. … Continue reading
Posted in Stata
2 Comments
Common commands to deal with date in Stata
egen compdatadate=eom(fiscalmonth fiscalyear) format compdatadate %td To be continued …
Posted in Stata
Leave a comment
Stata command to order tabulation result with only top values shown
tabulate varname command is handy in Stata, but sometimes it returns a too long result, if varname contains too many unique values. The thirdparty command, groups, will solve the problem by showing top values only. Please use ssc install groups … Continue reading
Posted in Stata
Leave a comment
Empower “and” and “or” in IF statement in Stata
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. But in Stata, we usually write: if fyear >= 2001 … Continue reading
Display mean and median test results in Stata
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 to test equality of mean and median. However, it is … Continue reading
Posted in Stata
21 Comments
Stata commands to do Heckman two steps
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 × b1 + u1 Selection equation: Dummy = Z × … Continue reading
Posted in Stata
7 Comments
Stata commands to test equality of mean and median
Please read this post for how to display the results in a readyforuse format. UCLA IDRE has posted an article (link) that may provide a bit more explanation. UCLA IDRE is a great resource for learning statistical analysis. A big thank you … Continue reading
Posted in Stata
3 Comments