Skip to content

Commit 54a9800

Browse files
committed
Bug fix, turn on mataopimize
1 parent 6ab83d4 commit 54a9800

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

boottest.mata

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
mata
1717
mata clear
1818
mata set matastrict on
19-
mata set matalnum on
20-
mata set mataoptimize off
19+
mata set mataoptimize on
20+
mata set matalnum off
2121
2222
string scalar boottestStataVersion() return("`c(stata_version)'")
2323
string scalar boottestVersion() return("02.01.00")
@@ -699,7 +699,7 @@ void boottestModel::boottest() {
699699
else
700700
pinfoBootData = &infoAllData
701701
} else
702-
pinfoBootData = &J(Nobs,0,0) // causes no collapsing of data in _panelsum() calls, only multiplying by weights if any
702+
pinfoBootData = &(infoAllData = J(Nobs,0,0)) // causes no collapsing of data in _panelsum() calls, only multiplying by weights if any
703703
NBootClust = rows(*pinfoBootData)
704704
705705
purerobust = NClustVar & !scoreBS & NBootClust==Nobs & !subcluster // do we ever error-cluster *and* bootstrap-cluster by individual?
@@ -1096,6 +1096,8 @@ real scalar boottestModel::MakeNonWRENumers(real scalar thisWeightGrpStart, real
10961096
10971097
10981098
1099+
1100+
10991101
void boottestModel::MakeNonWREStats(real scalar thisWeightGrpStart, real scalar thisWeightGrpStop) {
11001102
real scalar d, i, c, j, l; real matrix eu, eueu, t; real colvector numer_l
11011103
pointer (real matrix) scalar peZVR0, pVR0
@@ -1124,7 +1126,7 @@ void boottestModel::MakeNonWREStats(real scalar thisWeightGrpStart, real scalar
11241126
for (i=Clust.N;i;i--)
11251127
Kcd[d].M[i,i] = Kcd[d].M[i,i] - (*peZVR0)[i,d]
11261128
if (scoreBS | !(1 | hascons))
1127-
Kcd[d].M = Kcd[d].M + ClustShare * (*peZVR0)[,d]' // for score bootstrap, recenter; "+" because we subtracted *peZVR0
1129+
Kcd[d].M = Kcd[d].M :+ ClustShare * (*peZVR0)[,d]' // for score bootstrap, recenter; "+" because we subtracted *peZVR0
11281130
}
11291131
else
11301132
if (subcluster) // crosstab c,c* is wide

lboottest.mlib

-46 KB
Binary file not shown.

0 commit comments

Comments
 (0)