Skip to content

Commit f021914

Browse files
committed
Fixed failure to detect FE variable after xtreg, fe cluster()
1 parent 2da09c2 commit f021914

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

boottest.ado

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*! boottest 2.1.0 12 June 2018
1+
*! boottest 2.1.1 16 June 2018
22
*! Copyright (C) 2015-18 David Roodman
33

44
* This program is free software: you can redistribute it and/or modify
@@ -242,7 +242,7 @@ program define _boottest, rclass sortpreserve
242242
}
243243
local scoreBS = "`boottype'"=="score"
244244

245-
local FEname = cond(inlist("`cmd'","xtivreg","xtivreg2"), "`e(ivar)'", "`e(absvar)'`e(absvars)'")
245+
local FEname = cond(inlist("`cmd'","xtreg","xtivreg","xtivreg2"), "`e(ivar)'", "`e(absvar)'`e(absvars)'")
246246

247247
if `"`seed'"'!="" set seed `seed'
248248

@@ -379,10 +379,9 @@ program define _boottest, rclass sortpreserve
379379
if 0`hascns' mata _boottestC = st_matrix("`C'")[,(st_matrix("`keepC'"),cols(st_matrix("`C'")))]; _boottestC = select(_boottestC,rowsum(_boottestC:!=0)); st_matrix("`C'" , _boottestC)
380380

381381
if `GMM' mata st_matrix("`W'", st_matrix("`W'" )[st_matrix("`keepW'"), st_matrix("`keepW'")])
382-
383382
if `cons' local Xnames_exog `hold' `Xnames_exog' // add constant term
384383
}
385-
384+
386385
if `hasclust' {
387386
if 0`override' {
388387
cap assert !missing(`:subinstr local clustvars " " ",", all') if e(sample), `=cond(c(stata_version)>=12.1, "fast", "")'
@@ -578,13 +577,12 @@ program define _boottest, rclass sortpreserve
578577
}
579578

580579
return local seed = cond("`seed'"!="", "`seed'", "`c(seed)'")
581-
580+
582581
mata boottest_stata("`stat'", "`df'", "`df_r'", "`p'", "`padj'", "`cimat'", "`plotmat'", "`peakmat'", `level', `ML', `LIML', 0`fuller', `K', `ar', `null', `scoreBS', "`weighttype'", "`ptype'", ///
583582
"`madjust'", `N_h0s', "`Xnames_exog'", "`Xnames_endog'", 0`cons', ///
584583
"`Ynames'", "`b'", "`V'", "`W'", "`ZExclnames'", "`hold'", "`scnames'", `hasrobust', "`allclustvars'", `:word count `bootcluster'', `:word count `clustvars'', ///
585584
"`FEname'", "`wtname'", "`wtype'", "`C'", "`C0'", `reps', "`repsname'", "`repsFeasname'", `small', "`svmat'", "`dist'", ///
586585
`gridmin', `gridmax', `gridpoints', `matsizegb')
587-
588586
_estimates unhold `hold'
589587

590588
local reps = `repsname' // in case reduced to 2^G
@@ -698,6 +696,7 @@ program define _boottest, rclass sortpreserve
698696
end
699697

700698
* Version history
699+
* 2.1.1 Fixed failure to detect FE variable after xtreg, fe cluster()
701700
* 2.1.0 Added matsizegb feature.
702701
* Fixed 2.0.6 failure to subtract 1 from Mammen, Webb weights in WRE non-AR
703702
* Fixed failure in subcluster bootstrsap to sort data by error clusterings before bootstrap clustering

0 commit comments

Comments
 (0)