
reghdfe price length, absorb(turn trunk) cache(use) reghdfe price weight length, absorb(turn trunk) cache(save) Can I compute the transformations only once? I want to repeat a regression with different outcome variables. By choosing a smaller number of variables, it will create smaller temporary matrices, which might just be enough to avoid out–of–memory errors. By default, reghdfe applies the generalized within transformation to 10 variables at a time. If all else fails, use the pool(#) option of reghdfe with a smaller value (default is 10). compress long integers into short ones, recast double reals into short ones (with care), drop unused observations and variable. You can first try with the standard tricks of the trade. With Stata 14 or newer, it will not stop, but it will become very slow as it will use the hard drive instead of the computer memory. With Stata 13 or older, Stata will stop when out of memory. reghdfe y x1 x2, absorb(country#year) vce(cluster country#year) Often you want to absorb fixed effects at the exporter–importer level (in trade) or industry–year level (in finance). Number of clusters (trunk) = 18 Root MSE = 2415.7351 Number of clusters (turn) = 18 Within R-sq. Statistics robust to heteroskedasticity Prob > F = 0.0000 HDFE Linear regression Number of obs = 74
reghdfe price weight length, vce(cluster turn trunk) Just run reghdfe without the absorb() option. “… if the FE are nested, then the clustering adjustment already accounts for the degrees of freedom problem.” Lecture notes by Sam Hanson and Adi SunderamĬan I use reghdfe with multi-way clustering but without fixed effects?.
Statalist post on “super–observations” and the penalties of cluster–robust standard errors. Additionally, this approach is in line with packages such as xtreg and xtivreg2, although not with areg, which uses a different set of assumptions. This is done to avoid a double penalty for the fixed effects, as we have already penalized for them by using cluster–robust standard errors at the same level. However, as mentioned above, if a fixed effect variable is also a cluster variable (or is nested within a cluster variable), we do not consider it when computing the absorbed degrees of freedom. In general, we reduce the degrees of freedom by the number of fixed effects that are estimated by reghdfe. This adjustment depends on the absorbed degrees of freedom of the model (the degrees of freedom lost by controlling for the fixed effects). When reghdfe computes the VCE matrix, it multiplies the asymptotic VCE matrix by a small sample adjustment (see the formula for “q” here). To disable the adjustment, see the dof(.) section of the help file. * = fixed effect nested within cluster treated as redundant for DoF computation reghdfe price weight length, absorb(turn trunk) vce(cluster turn) (output omitted)Ībsorbed FE | Num. If this option is triggered, you will see the message “fixed effect nested within cluster treated as redundant for DoF computation” in the second output table of reghdfe. state but will not use the number of counties when computing the absorbed degrees of freedom. Whenever this happens, reghdfe will avoid applying a double penalty to the standard errors: it will continue to cluster by e.g. For instance, if we have state–clustered standard errors and county–level fixed effects, or with clustering by year and monthly fixed effects. ) and in absorb(.) or-more generally-if a cluster variable is coarser than a fixed effect variable. What does “fixed effect nested within cluster” means?Ī fixed effect is “nested within cluster” if the same variable is used in vce(cluster. In my model the number of FEs varies by observation. How can I combine reghdfe with esttab or estout?. Why are there four R2s? Which one should I use?. I want to repeat a regression with different outcome variables. Can I absorb the fixed effects formed by the combination of two variables?. Can I use reghdfe with multi-way clustering but without fixed effects?. What does “fixed effect nested within cluster” means?. STATA 12 SE MAXIMUM VARIABLES INSTALL
Index Install Quickstart FAQ Cite Help Help+