help for group2hdfe ()

Title

group2hdfe - Computes the number of restrictions in a linear regression model with two high dimensional fixed effects.

Syntax

group2hdfe varname1 varname2, [options]

Description

This command calculates the number of restrictions needed to ensure identifiability of the fixed effects
in a linear regression model with two high dimensional fixed effects (2hdfe). The number of restrictions is stored
in r(rest). The command is a Mata implementation of the a2group developed by Amine Ouazad.

Options

group (new varname) Creates a new variable with an indicator for membership
to each connected set.

largest (new varname) Creates a new variable with an indicator for membership to the
largest connected dataset.

verbose Provides more information while the algorithm is running.

Examples

Example 1:

Compute the number of restrictions in the data and display it.

. group2hdfe i j

. display r(rest)

Example2:

Identify the largest "connected" data set

. group2hdfe i j, largest(big)

. keep if big==1

Saved Results

group2hdfe saves the following in r():

Scalars

r(rest) number of restrictions (connected sets).

Acknowledgment

This command was based on a previous version of Amine Ouazad's a2group command.

Author

Paulo Guimaraes, BPlim, Banco de Portugal, Portugal.

Email: pguimaraes2001@gmail.com

Comments welcome!

Also see

reghdfe (if installed).