Skip to content

Commit

Permalink
Fix crash in AR when point estimate<0 and CI requested
Browse files Browse the repository at this point in the history
  • Loading branch information
droodman committed Nov 10, 2023
1 parent 11e4cdd commit 7943a02
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ Function to perform wild-bootstrap-based hypothesis test
* `clustid::AbstractVecOrMat{<:Integer}`: data vector/matrix of error and bootstrapping cluster identifiers; see notes
* `nbootclustvar::Integer=size(clustid,2)`: number of bootstrap-clustering variables
* `nerrclustvar::Integer=nbootclustvar`: number of error-clustering variables
* `issorted:Bool=false`: time-saving flag: data matrices are already sort by column types 2, then 3, then 1 (see notes)
* `issorted:Bool=false`: time-saving flag: data matrices are already sorted by column types 2, then 3, then 1 (see notes)
* `hetrobust::Bool=true`: true unless errors are treated as iid
* `feid::AbstractVector{<:Integer}`: data vector for one-way fixed effect group identifier
* `fedfadj::Integer`: degrees of freedom that fixed effects (if any) consume; defaults to number of FEs
Expand Down
2 changes: 1 addition & 1 deletion src/plot-CI.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function plot!(o::StrBootTest{T}) where T
if o.arubin
# p = o.dist[1] * o.multiplier
# p = ccdf(Chisq{T}(T(o.dof)), o.sqrt ? p^2 : p)
halfwidth = abs.(o.confpeak * sqrtNaN((o.dist[1] * o.multiplier) / o.dof) / Phi) # abs.(o.confpeak) * quantile(Normal{T}(zero(T),one(T)), p/2) / Phi
halfwidth = abs.(o.confpeak * sqrtNaN((abs(o.dist[1]) * o.multiplier) / o.dof) / Phi) # abs.(o.confpeak) * quantile(Normal{T}(zero(T),one(T)), p/2) / Phi
else
halfwidth = T(-1.5) * Phi .* sqrtNaN.(diag(getV(o)))
any(isnan.(halfwidth)) && return
Expand Down

0 comments on commit 7943a02

Please sign in to comment.