Skip to content

Commit

Permalink
Merge pull request #12 from PharmCat/dev
Browse files Browse the repository at this point in the history
dispersion table, update MetidaBase
  • Loading branch information
PharmCat authored Jan 16, 2025
2 parents cd09a95 + b06dc35 commit 73ee229
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ uuid = "00e1d80e-504f-4d7b-946f-0aea2e7abfe3"
keywords = ["bioequivalence"]
desc = "Bioequivalence"
authors = ["Vladimir Arnautov <[email protected]>"]
version = "0.2.7"
version = "0.2.8"

[deps]
CategoricalArrays = "324d7699-5711-5eae-9e2f-1d82baa6b597"
Expand All @@ -22,7 +22,7 @@ DataFrames = "1"
Distributions = "0.21, 0.22, 0.23, 0.24, 0.25"
GLM = "1.8"
Metida = "0.15"
MetidaBase = "0.12"
MetidaBase = "0.12, 0.13, 0.14"
MetidaNCA = "0.5"
MixedModels = "4"
StatsBase = "0.30, 0.31, 0.32, 0.33, 0.34"
Expand Down
2 changes: 1 addition & 1 deletion src/MetidaBioeq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module MetidaBioeq

import Base: show

import MetidaBase: cvfromsd, sdfromcv
import MetidaBase: cvfromsd, cvfromvar, sdfromcv

export result, bioquivalence, estimate, makeseq, cvfromsd, sdfromcv

Expand Down
14 changes: 10 additions & 4 deletions src/bioequivalence.jl
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ function estimate(be; estimator = "auto", method = "auto", supresswarn = false,
if estimator == "glm"

results = [fit(LinearModel, m, be.data; contrasts = Dict(be.formulation => DummyCoding(base = be.reference)), dropcollinear = true) for m in models]
dfvar = dfdict[:var] = DataFrame(Parameter = String[], Metric = String[], SE = Float64[], CV = Float64[])
dfvar = dfdict[:var] = DataFrame(Parameter = String[], Metric = String[], σ²= Float64[], CV = Float64[])

for i in results
DF = dof_residual(i)
Expand All @@ -572,11 +572,16 @@ function estimate(be; estimator = "auto", method = "auto", supresswarn = false,
exp(CI[2])*100,
(1-2alpha)*100
))

σ² = GLM.dispersion(i.model, true)
push!(dfvar, (string(coefnames(i)[2], " - ", be.reference),
coefnames(i.mf.f.lhs),
sevec[2],
cvfromsd(sevec[2]) * 100
σ²,
cvfromvar(σ²) * 100
))



end

# If Metida Used
Expand Down Expand Up @@ -652,7 +657,8 @@ function estimate(be; estimator = "auto", method = "auto", supresswarn = false,
end

end
BEResults(be, results, Dict(:result => df), estimator, method)

BEResults(be, results, dfdict, estimator, method)
end

"""
Expand Down

2 comments on commit 73ee229

@PharmCat
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/123157

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.8 -m "<description of version>" 73ee22914e18b34f3ad271e1a5798360c9bacdf3
git push origin v0.2.8

Please sign in to comment.