Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
markgpritchard committed Mar 21, 2024
1 parent df653ac commit e49e704
Showing 1 changed file with 36 additions and 36 deletions.
72 changes: 36 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
[![Build Status](https://github.com/markgpritchard/TableOne.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/markgpritchard/TableOne.jl/actions/workflows/CI.yml?query=branch%3Amain)
[![codecov](https://codecov.io/gh/markgpritchard/TableOne.jl/graph/badge.svg?token=2FWXZYCS0I)](https://codecov.io/gh/markgpritchard/TableOne.jl)

Package to produce a summary table which may be used as Table 1 in a manuscript.
Package to produce a summary table which may be used as Table 1 in a manuscript. Functions are supplied to give equivalence to the R package `tableone` by Kazuki Yoshida.

Version 0.2 contains all the functionality I currently plan to add. Please let me know if there is anything you think should be added, either as an *Issue* or a *Pull request*.

Also, please let me know if you use the package, if it works well for you and if there are any problems.

# Installation

Expand All @@ -24,48 +28,44 @@ We use a publicly available Primary Biliary Cholangitis dataset to create an exa
julia> using TableOne, CSV, DataFrames, Downloads

julia> pbcdata = CSV.read(
Downloads.download("http://www-eio.upc.edu/~pau/cms/rdata/csv/survival/pbc.csv"),
DataFrame;
missingstring = "NA")
[...]
Downloads.download("http://www-eio.upc.edu/~pau/cms/rdata/csv/survival/pbc.csv"),
DataFrame;
missingstring="NA");

julia> tableone(
pbcdata,
:trt,
[ "age", "sex", "hepato", "edema", "bili", "chol", "stage" ];
binvars = [ "sex", "hepato" ],
catvars = [ "edema", "stage" ],
npvars = [ "bili", "chol" ],
digits = 2,
binvardisplay = Dict("sex" => "f"),
varnames = Dict(
"age" => "Age, years",
"hepato" => "Hepatomegaly",
"bili" => "Bilirubin: mg/dL",
"chol" => "Cholesterol: mg/dL"
)
)
15×4 DataFrame
Row │ variablenames 1 2 nmissing
│ String String String String
─────┼────────────────────────────────────────────────────────────────────────────────────────
1 │ n 158 154 106
2 │ Age, years: mean (sd) 51.42 (11.01) 48.58 (9.96) 0
3 │ sex: f 137 (86.71) 139 (90.26) 0
4 │ Hepatomegaly: 1 73 (46.2) 87 (56.49) 0
5 │ edema 0
pbcdata,
:trt,
[ "age", "sex", "hepato", "edema", "bili", "chol", "stage" ];
binvars = [ "sex", "hepato" ],
catvars = [ "edema", "stage" ],
npvars = [ "bili", "chol" ],
digits = 2,
pvalues=true,
binvardisplay = Dict("sex" => "f"),
varnames = Dict(
"age" => "Age, years",
"hepato" => "Hepatomegaly",
"bili" => "Bilirubin: mg/dL",
"chol" => "Cholesterol: mg/dL"
)
)
15×5 DataFrame
Row │ variablenames 1 2 nmissing p
│ String String String String String
─────┼────────────────────────────────────────────────────────────────────────────────────────────────
1 │ n 158 154 106
2 │ Age, years: mean (sd) 51.42 (11.01) 48.58 (9.96) 0 0.018
3 │ sex: f 137 (86.71) 139 (90.26) 0 0.422
4 │ Hepatomegaly: 1 73 (46.2) 87 (56.49) 0 0.088
5 │ edema 0 0.877
60.0 132 (83.54) 131 (85.06)
70.5 16 (10.13) 13 (8.44)
81.0 10 (6.33) 10 (6.49)
9 │ Bilirubin: mg/dL: median [IQR] 1.4 [0.83.2] 1.3 [0.723.6] 0
10 │ Cholesterol: mg/dL: median [IQR] 315.5 [247.75417.0] 303.5 [254.25377.0] 28
11 │ stage 0
9 │ Bilirubin: mg/dL: median [IQR] 1.4 [0.83.2] 1.3 [0.723.6] 0 0.842
10 │ Cholesterol: mg/dL: median [IQR] 315.5 [247.75417.0] 303.5 [254.25377.0] 28 0.544
11 │ stage 0 0.201
121 12 (7.59) 4 (2.6)
132 35 (22.15) 32 (20.78)
143 56 (35.44) 64 (41.56)
154 55 (34.81) 54 (35.06)
```

# Issues

This package is early in its development. Please list any problems under the *Issues* tab.

0 comments on commit e49e704

Please sign in to comment.