Search this site
Embedded Files
Yuya Sasaki - Professor of Economics - Vanderbilt University
  • HOME
    • CV
    • RESEARCH
    • STATA
      • Stata Command: cdecompose
      • Stata Command: crhdreg
      • Stata Command: dkdensity
      • Stata Command: exquantile
      • Stata Command: itvalpctile
      • Stata Command: kotlarski
      • Stata Command: npeivreg
      • Stata Command: npss
      • Stata Command: qrkd
      • Stata Command: rdqte
      • Stata Command: reporterror
      • Stata Command: rkqte
      • Stata Command: robustate
      • Stata Command: robustpf
      • Stata Command: testex
      • Stata Command: testout
      • Stata Command: xtusreg
      • Stata Command: xtregtwo
      • Stata Command: ecic
      • Stata Command: oga
    • STUDENTS
    • TEACHING
    • 日本語
Yuya Sasaki - Professor of Economics - Vanderbilt University
  • HOME
    • CV
    • RESEARCH
    • STATA
      • Stata Command: cdecompose
      • Stata Command: crhdreg
      • Stata Command: dkdensity
      • Stata Command: exquantile
      • Stata Command: itvalpctile
      • Stata Command: kotlarski
      • Stata Command: npeivreg
      • Stata Command: npss
      • Stata Command: qrkd
      • Stata Command: rdqte
      • Stata Command: reporterror
      • Stata Command: rkqte
      • Stata Command: robustate
      • Stata Command: robustpf
      • Stata Command: testex
      • Stata Command: testout
      • Stata Command: xtusreg
      • Stata Command: xtregtwo
      • Stata Command: ecic
      • Stata Command: oga
    • STUDENTS
    • TEACHING
    • 日本語
  • More
    • HOME
      • CV
      • RESEARCH
      • STATA
        • Stata Command: cdecompose
        • Stata Command: crhdreg
        • Stata Command: dkdensity
        • Stata Command: exquantile
        • Stata Command: itvalpctile
        • Stata Command: kotlarski
        • Stata Command: npeivreg
        • Stata Command: npss
        • Stata Command: qrkd
        • Stata Command: rdqte
        • Stata Command: reporterror
        • Stata Command: rkqte
        • Stata Command: robustate
        • Stata Command: robustpf
        • Stata Command: testex
        • Stata Command: testout
        • Stata Command: xtusreg
        • Stata Command: xtregtwo
        • Stata Command: ecic
        • Stata Command: oga
      • STUDENTS
      • TEACHING
      • 日本語

< Back to STATA Main Page

Stata Command: xtregtwo

Stata Command: xtregtwo.ado

The output displayed below shows fixed effect estimates of the standard Fama-French three-factor regression with novel standard errors that are robust against clustering by firms, clustering by months, and serial correlation in unobserved macroeconomic effects.  It is implemented by the  Stata command xtregtwo, which executes estimation of linear panel regression models with standard errors robust to two-way clustering and untruncated serial correlation in common time effects.

Installation:    

    . ssc install xtregtwo 

Usage:

    . use "fama_french.dta"

    . xtset i t

    . xtregtwo return mkt smb hml, fe 

Help:

    . help xtregtwo

Reference:  Chiang, H.D., B.E. Hansen, and Y. Sasaki (2024: forthcoming) Standard Errors for Two-Way Clustering with Serially Correlated Time Effects. Review of Economics and Statistics. Paper.


Title
    xtregtwo -- Executes estimation of panel regression with standard errors        robust to two-way clustering and serial correlation in time effects.

Syntax     xtregtwo depvar [indepvars] [if] [in] [, noconstant fe]

Description
    xtregtwo executes estimation of linear panel regression models with        standard errors robust to two-way clustering and untruncated serial        correlation in common time effects.  The method is based on Chiang,        Hansen, and Sasaki (2024).  The command reports the ordinary least        squares estimates, robust standard errors, z values, p values, and        confidence intervals.  The command runs the fixed-effect estimation by        within-i transformation if the fe option is used.  The command runs        the two-way fixed-effect estimation by within-i and within-t        transformations if the twfe option is used.  Note that the standard        errors would be generally invalid without two-way clustering even when        one- or two-way fixed effects are included -- see Section 4 of Chiang,        Hansen, and Sasaki (2024).

Options
    noconstant  suppress constant term
    fe          fixed effects by within-transformation

Example
    Load the asset pricing data:
    . use "fama_french.dta"
    Set i and t variables in the panel:
    . xtset i t
    Estimation:
    . xtregtwo return mkt smb hml, fe

Stored results
    xtregtwo stores the following in e():
    Scalars        e(NT)          observations        e(N)           cross sectional units        e(T)           time periods        e(M)           time window for HAC estimation
    Macros        e(cmd)         xtregtwo        e(properties)  b V
    Matrices        e(b)           coefficient vector        e(V)           variance-covariance matrix of the estimators
    Functions        e(sample)      marks estimation sample
Reference
    Chiang, H.D., B.E. Hansen, and Y. Sasaki 2024. Standard Errors for Two-Way        Clustering with Serially Correlated Time Effects. Review of Economics        and Statistics, forthcoming.  Link to Paper.

Authors
    Harold D. Chiang, University of Wisconsin, Madison, WI.
    Bruce E. Hansen, University of Wisconsin, Madison, WI.
    Yuya Sasaki, Vanderbilt University, Nashville, TN.
Google Sites
Report abuse
Page details
Page updated
Google Sites
Report abuse