*! version 1.0 9 Apr 2021

Title

suregr -- User written post estimation command suregr, mnemonic for suregr[obust]:
Calculates robust, or cluster-robust variance post [R] sureg Seemingly Unrelated Regressions estimation.
Requires Stata 11. Written by Gueorgui I. Kolev in March 2021.

Syntax

suregr
[,
options]

Optional
cluster(clustvar)
The command suregr can only be called after a Seemingly Unrelated Regressions model has been fit through sureg, that is, suregr is a post estimation command.
By default suregr produces robust variance and robust standard errors of the parameter estimates.
If the user wishes the variance and standard errors to be cluster-robust, the user specifies this through the option cluster(clustvar) with the variable defining the clusters (clustvar) in parentheses.

minus(#)
Controls the degrees of freedom adjustment factor in the robust, or cluster-robust variance calculation.
Default value is minus(0), which is equivalent to no degrees of freedom adjustment.
This option is inherited from [P] _robust and detailed instructions of how to apply the degrees of freedom adjustment through the option minus(#) are given in the manual entry for [P] _robust.

noheader
This option suppresses the header of the [R] sureg regression table. The default is to display the header of the regression table.

Description

Stata's [R] sureg estimates Arnold Zellner's Seemingly Unrelated Regressions model.
However [R] sureg cannot estimate robust or cluster-robust variance matrix and standard errors for the parameter estimates.
Gueorgui I. Kolev (2021) "Robust and/or cluster-robust variance estimation in Seemingly Unrelated Regressions, and in Multivariate Regressions" shows
the relevant formulae for robust and cluster-robust variance and standard errors,
and these formulae are automatically implemented by the post estimation command suregr.
Important: all that suregr does is replace the estimated non-robust variance with robust or cluster-robust variance. Therefore
1) everything that can be done with sureg remains the same, e.g., one can apply linear constraints in the sureg stage of the estimation.
2) Similarly suregr returns the robust or cluster-robust variance in the proper format, so that further post estimation commands
after suregr proceed as usual, e.g., [R] test, [R] lincom, [R] nlcom, etc., proceed after suregr as usual, and work as usual.

Options

Main

cluster(varname)

minus(#)

noheader

Examples

sysuse auto, clear

* Typical use of -suregr-, we firstly fit -sureg- quietly, and then we follow up with -suregr-
* to get the robust variance.
* If we do not specify the minus option, the default is minus(0) meaning no degrees of freedom adjustment.
* Of course if we want to see the non-robust standard errors as well we can also run -sureg- noisily.

quietly sureg (price headroom) (mpg weight length)

suregr

* Typical use for getting the cluster-robust variance follows. We use the minus(1) degrees of freedom adjustment,
* because this is the common adjustment cluster-robust variance estimators in native Stata commands use.
* We also use the option noheader to omit the header from our regression table.

quietly sureg (price headroom) (mpg weight length)

suregr, cluster(rep) minus(1) noheader

* Post estimation after -suregr- works as usual.
* -suregr- has substituted the (cluster-)robust variance, and the post estimation commands like -test-
* -lincom- and -nlcom- use the (cluster-)robust variance in the calculations they are carrying out:

quietly sureg (price headroom) (mpg weight length)

suregr, cluster(rep) minus(1) noheader

test [price]headroom = [mpg]weight

nlcom [price]headroom/[mpg]weight

* Imposing linear constraints works as usual too

constraint define 1 [price]headroom = [mpg]weight

quietly sureg (price headroom) (mpg weight length), constraint(1)

suregr, noheader

References

Kolev, Gueorgui I. (2021). Robust and/or cluster-robust variance estimation in Seemingly Unrelated Regressions, and in Multivariate Regressions.
(under review at the Stata Journal, available upon request from the author).

Author

Gueorgui I. Kolev
joro.kolev@gmail.com
version 1: 08 Oct 2020