Skip to content

Commit

Permalink
output fix
Browse files Browse the repository at this point in the history
  • Loading branch information
PharmCat committed Nov 13, 2019
1 parent 2aef6c0 commit ba76e52
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/ReplicateBE.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ using DataFrames, Distributions, StatsModels, StatsBase, ForwardDiff, LinearAlge
import Base.show
import StatsBase.confint, StatsBase.coef, StatsBase.nobs, StatsBase.dof, StatsBase.stderror
import Statistics.var
#import StatsBase.vcov, StatsBase.coeftable, StatsBase.loglikelihood

const LOG2PI = log(2π)
const MEMOPT = true
Expand Down
12 changes: 6 additions & 6 deletions src/rbe.jl
Original file line number Diff line number Diff line change
Expand Up @@ -535,13 +535,13 @@ function Base.show(io::IO, rbe::RBE)
println(io, "")
println(io, "Fixed effect:")
println(io, rbe.fixed)
println(io, "Intra-individual variation:")
println(io, "Intra-individual variance:")

printmatrix(io,[rcoef[1] round(θ[1], sigdigits=6) "CVᵂ:" round(geocv(θ[1]), sigdigits=6);
rcoef[2] round(θ[2], sigdigits=6) "CVᵂ:" round(geocv(θ[2]), sigdigits=6)])
printmatrix(io,[rcoef[1] round(θ[1], sigdigits=6) "CVᵂ:" round(geocv(θ[1])*100, digits=2) "%";
rcoef[2] round(θ[2], sigdigits=6) "CVᵂ:" round(geocv(θ[2])*100, digits=2)] "%")
println(io, "")

println(io, "Inter-individual variation:")
println(io, "Inter-individual variance:")

printmatrix(io,[rcoef[1] round(θ[3], sigdigits=6) "";
rcoef[2] round(θ[4], sigdigits=6) "";
Expand All @@ -551,8 +551,8 @@ function Base.show(io::IO, rbe::RBE)
println(io, "Confidence intervals(90%):")
ci = confint(rbe, 0.1, expci = true, inv = true)
println(io, rcoef[1], " / ", rcoef[2])
println(io, round(ci[end][1]*100, digits=4), " - ", round(ci[end][2]*100, digits=4), " (%)")
println(io, "Ratio: $(round(exp(-coef(rbe)[end])*100, digits=2)), CI: ", round(ci[end][1]*100, digits=2), " - ", round(ci[end][2]*100, digits=2), " (%)")
ci = confint(rbe, 0.1, expci = true, inv = false)
println(io, rcoef[2], " / ", rcoef[1])
print(io, round(ci[end][1]*100, digits=4), " - ", round(ci[end][2]*100, digits=4), " (%)")
print(io,"Ratio: $(round(exp(coef(rbe)[end])*100, digits=2)), CI: ", round(ci[end][1]*100, digits=2), " - ", round(ci[end][2]*100, digits=2), " (%)")
end #─┼┴┬│
2 changes: 1 addition & 1 deletion src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ function printmatrix(io::IO, m::Matrix)
sm = string.(m)
lv = maximum(length.(m), dims = 1)
for r = 1:size(sm, 1)
for c = 1:size(sm, 1)
for c = 1:size(sm, 2)
print(io, addspace(sm[r,c], lv[c] - length(sm[r,c]))*" ")
end
println(io, "")
Expand Down

0 comments on commit ba76e52

Please sign in to comment.