Skip to content

Commit

Permalink
(minor update) add groupreg compat
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiocorreia committed Nov 5, 2020
1 parent 9f8dafc commit fcb4e14
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/ftools.ado
Original file line number Diff line number Diff line change
@@ -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
Expand Down
20 changes: 20 additions & 0 deletions src/ftools_main.mata
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
7 changes: 5 additions & 2 deletions src/ms_parse_absvars.ado
Original file line number Diff line number Diff line change
@@ -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] ///
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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'
Expand Down

0 comments on commit fcb4e14

Please sign in to comment.