Skip to content

Commit

Permalink
Fix #93
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiocorreia committed Apr 17, 2017
1 parent d137109 commit 9503eee
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/reghdfe.ado
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*! version 4.1.3 06apr2017
*! version 4.1.4 17apr2017

program reghdfe, eclass
* Intercept old+version
Expand Down
2 changes: 1 addition & 1 deletion src/reghdfe.sthlp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{smcl}
{* *! version 4.1.3 06apr2017}{...}
{* *! version 4.1.4 17apr2017}{...}
{vieweralsosee "[R] areg" "help areg"}{...}
{vieweralsosee "[R] xtreg" "help xtreg"}{...}
{vieweralsosee "[R] ivregress" "help ivregress"}{...}
Expand Down
12 changes: 11 additions & 1 deletion src/reghdfe_common.mata
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,26 @@ mata:
`Variable' resid
`Real' eps
`Integer' i
`StringRowVector' indepvars
if (S.timeit) timer_on(90)
reghdfe_solve_ols(S, X, b=., V=., N=., rank=., df_r=., resid=.)
if (S.timeit) timer_off(90)
st_matrix(bname, b')
// Add "o." prefix to omitted regressors
eps = sqrt(epsilon(1))
indepvars = tokens(S.indepvars)
for (i=1; i<=rows(b); i++) {
if (abs(b[i])<eps) printf("{txt}note: %s omitted because of collinearity\n", tokens(S.indepvars)[i])
if (abs(b[i])<eps) {
printf("{txt}note: %s omitted because of collinearity\n", indepvars[i])
stata(sprintf("_ms_put_omit %s", indepvars[i]))
indepvars[i] = st_global("s(ospec)")
}
}
S.indepvars = invtokens(indepvars)
st_matrix(Vname, V)
st_numscalar(nname, N)
st_numscalar(rname, rank)
Expand Down

0 comments on commit 9503eee

Please sign in to comment.