Skip to content

Commit

Permalink
Merge pull request #31 from PharmCat/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
PharmCat committed Nov 30, 2019
2 parents 7434444 + f73553c commit c2d4757
Show file tree
Hide file tree
Showing 39 changed files with 378 additions and 4,730 deletions.
3 changes: 3 additions & 0 deletions .gitignore
@@ -1,4 +1,7 @@
*.jl.cov
*.jl.*.cov
*.jl.mem
test/csv/rds/
docs/build/
docs/deprecated
examples
12 changes: 6 additions & 6 deletions Project.toml
Expand Up @@ -4,14 +4,13 @@ uuid = "535c2557-d7d0-564d-8ff9-4ae146c18cfe"
version = "0.2.0"

[deps]
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Roots = "f2b01f46-fcfa-551c-844a-d8ac1e96c665"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"

[extras]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
Expand All @@ -21,10 +20,11 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
test = ["CSV", "Test"]

[compat]
julia = "1.0, 1.1, 1.2"
DataFrames = "0.19"
julia = "1.0, 1.1, 1.2, 1.3"
Distributions = "0.16, 0.17, 0.18, 0.19, 0.20, 0.21"
StatsBase = "0.22, 0.23, 0.24, 0.25, 0.26, 0.27, 0.28, 0.29, 0.30, 0.31, 0.32"
CSV = "0.5"
DataFrames = "0.19"
QuadGK = "2.0, 2.1"
SpecialFunctions = "0.8, 0.9"
Roots = "0.7, 0.8"
CSV = "0.5"
29 changes: 19 additions & 10 deletions README.md
Expand Up @@ -19,7 +19,6 @@ The package is designed to perform calculations related to the planning and anal
using Pkg; Pkg.add("ClinicalTrialUtilities");
```


### <a name="Usage">Usage</a>

**NB! Hypothesis types:**
Expand All @@ -28,9 +27,9 @@ using Pkg; Pkg.add("ClinicalTrialUtilities");
- :ei - Equivalencens: two one-sided hypothesis;
- :ns - Non-Inferiority / Superiority: one-sided hypothesis, for some cases you should use two-sided hypothesis for Non-Inferiority/Superiority, you can use alpha/2 for this;


### <a name="Examples">Examples</a>

#### SampleSize
```
#Sample size for one proportion equality
ctsamplen(param=:prop, type=:ea, group=:one, a=0.3, b=0.5)
Expand All @@ -40,18 +39,25 @@ ctsamplen(param=:mean, type=:ei, group=:two, diff=0.3, sd=1, a=0.3, b=0.5)
ctsamplen(param=:or, type=:ns, diff=-0.1, a=0.3, b=0.5, k=2)
#Odd ratio equality
ctsamplen(param=:or, type=:ea, a=0.3, b=0.5, k=2)
```

#Power
ctpower(param=:mean, type=:ea, group=:one, a=1.5, b=2, sd=1,n=32, alpha=0.05)
#Bioequivalence sample size
#### Bioequivalence sample size
```
besamplen(alpha=0.05, theta1=0.8, theta2=1.25, theta0=0.95, cv=0.15, method=:owenq)
besamplen(cv=0.20, method=:nct)
besamplen(cv=0.347, design=:parallel)
besamplen(cv=0.40)
besamplen(cv=0.347, design=:d2x2x4, method=:nct)
```

#Bioequivalence power for 2x2 design, default method - OwensQ
#### Power
```
ctpower(param=:mean, type=:ea, group=:one, a=1.5, b=2, sd=1,n=32, alpha=0.05)
```

#### Bioequivalence power
```
#2x2 design, default method - OwensQ
bepower(alpha=0.05, logscale=true, theta1=0.8, theta2=1.25, theta0=0.95, cv=0.2, n=20, design=:d2x2, method=:owenq)
#Same
bepower(alpha=0.05, cv=0.2, n=20, design=:d2x2)
Expand All @@ -62,11 +68,15 @@ bepower(alpha=0.1, logscale=false, theta1=-0.1, theta2=0.1, theta0=0, cv=0.14, n
#Simple notations
bepower(cv=0.4, n=35, design=:d2x4x4)
bepower(cv=0.14, n=21)
```

#CV from CI
#### Bioequivalence CV from CI
```
cvfromci(;alpha = 0.05, theta1 = 0.9, theta2 = 1.25, n=30, design=:d2x2x4)
```

#Polled CV
#### Polled CV
```
data = DataFrame(cv = Float64[], df = Int[])
push!(data, (0.12, 12))
push!(data, (0.2, 20))
Expand All @@ -75,7 +85,6 @@ pooledcv(data; cv=:cv, df=:df, alpha=0.05, returncv=true)
```


### <a name="Copyrights">Copyrights</a>

Clinical Trial Utilities
Expand Down
239 changes: 0 additions & 239 deletions docs/CI.md

This file was deleted.

2 comments on commit c2d4757

@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 register

Release notes:

v0.2.0

Breaking changes(!):

  • Renamed exported functions: ctsamplen, ctpower, besamplen, bepower, ets (now in lower case).
  • nca() -> nca!() - renamed;
  • Changes in ctsamplen() in one group estimation. In version 0.1.x test mean/proportion denoted as parameter/keyword "a" was a "Reference".
    This situation was inconsistent with two group analysis where "a" - T, "b" - R. Now everywhere "a" means "Test group", "b" means "Reference group".
    Hypothesis testing for difference is A-B everywhere.
  • Keyword "logdiff" removed in ctsamplen(), because this was inconsistent with bepower/besamplen, new parameter logscale using instead.
  • Keyword "out" removed everywhere. Output via Base.show(io::IO, obj::TaskResult);
  • twoProp(), oneProp(), oneMean. twoMeans() removed;
  • No submodule politics.

Major changes:

  • using DataFrames 19.0+
  • Task types for many functions (sample size, power functions, random ets.);
  • Sample size and power functions now return TaskResult{T <: CTask};
  • descriptive() rewrited;
  • DataSet type;
  • make DataFrame from DataSet;
  • Descriptive type;
  • CMH CI split;
  • randomtable() return DF
  • Include CI in ClinicalTrialUtilities & StatsBase methods for AbstractParameter types.

Other changes:

  • Changes in error messages. Now throw(ArgumentError(msg));
  • LimitRule for PK;
  • RMIN/RMAX/TH/BL for PD;
  • Steady-state PK and other PK parameters;
  • Descriptive stats add SES and SEK;
  • Descriptive performance;
  • Test procedures restructured;
  • 4x4 design;
  • Documentation;
  • Minor changes, bugfix, code cleaning, cosmetics.

@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/6081

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 Julia TagBot is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.0 -m "<description of version>" c2d4757739cdc2195f589d6506c43024c4d6ff94
git push origin v0.2.0

Please sign in to comment.