From fcb4e147a8304420657120db5c6f967749d1f6ba Mon Sep 17 00:00:00 2001 From: Sergio Correia Date: Wed, 4 Nov 2020 23:26:57 -0500 Subject: [PATCH] (minor update) add groupreg compat --- src/ftools.ado | 2 +- src/ftools_main.mata | 20 ++++++++++++++++++++ src/ms_parse_absvars.ado | 7 +++++-- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/ftools.ado b/src/ftools.ado index 37a3116..66aea4d 100644 --- a/src/ftools.ado +++ b/src/ftools.ado @@ -1,4 +1,4 @@ -*! version 2.40.0 25aug2020 +*! version 2.41.0 02nov2020 * This file is just used to compile ftools.mlib program define ftools diff --git a/src/ftools_main.mata b/src/ftools_main.mata index 1c80c70..41ebb0a 100644 --- a/src/ftools_main.mata +++ b/src/ftools_main.mata @@ -42,7 +42,27 @@ class Factor `Vector' intersect() // 1 if Y intersects with F.keys + // Undocumented `Dict' extra // extra information + + // Undocumented for reghdfe / groupreg + `String' absvar // expression: "firm#year", "i.firm##c.(x1 x2)", etc. + `Varlist' ivars // variables used for intercepts + `Varlist' cvars // variables used for slopes + `Boolean' has_intercept // 1 for "firm" or "firm##c.year" ; 0 for "firm#c.year" + `Integer' num_slopes // number of slopes + `String' target // where the FE will be saved + `Boolean' save_fe // 1 if we save the FE + + // Undocumented objects used for slope variables (cvars) in reghdfe/groupreg + `Matrix' x // standardized slope variables "x1 x2.." + `RowVector' x_means // means of slope variables + `RowVector' x_stdevs // standard deviations of slope variables + `Matrix' inv_xx // inv(x'x) for each fixed effect + + `Boolean' has_weights + `Vector' weights + `Vector' weighted_counts } diff --git a/src/ms_parse_absvars.ado b/src/ms_parse_absvars.ado index 6edad9d..001892b 100644 --- a/src/ms_parse_absvars.ado +++ b/src/ms_parse_absvars.ado @@ -1,6 +1,6 @@ -*! version 2.33.0 26jan2019 +*! version 2.41.0 02nov2020 program ms_parse_absvars, sclass - syntax [anything(id="absvars" name=absvars equalok everything)], /// Allow for no abosvars + syntax [anything(id="absvars" name=absvars equalok everything)], /// Allow for no absvars [NOIsily] /// passed to -ms_fvunab- [SAVEfe Generate] /// Synonyms [REPLACE] /// @@ -17,6 +17,7 @@ program ms_parse_absvars, sclass sreturn loc targets = `" """' sreturn loc cvars = `" """' sreturn loc ivars = `"_cons"' + sreturn loc basevars = `""' sreturn loc absvars = `" """' sreturn loc save_all_fe = 0 sreturn loc save_any_fe = 0 @@ -28,6 +29,7 @@ program ms_parse_absvars, sclass * Unabbreviate variables and trim spaces UnabAbsvars `absvars', `noisily' target stringok `replace' + loc basevars `s(basevars)' loc absvars `s(varlist)' * Count the number of absvars @@ -129,6 +131,7 @@ program ms_parse_absvars, sclass sreturn loc targets = `"`all_targets'"' sreturn loc cvars = `"`all_cvars'"' sreturn loc ivars = `"`all_ivars'"' + sreturn loc basevars = `"`basevars'"' sreturn loc absvars = `"`all_absvars'"' sreturn loc save_all_fe = `save_all_fe' sreturn loc save_any_fe = `save_any_fe'