The Variability page's "Summary Statistics" and "Plots" tabs: summary statistics of the sampled subjects (all, and males and females), the age and weight distributions by sex, and the distribution of a custom covariate with its median and 95% range.
Arguments
- x
A population from
mvp_population(), or a population result ofmvp_simulate().- by_sex
Also summarise males and females separately (when both are present).
- var
NULL(default) for the age and weight plot (needs a database population); or a covariate, e.g."CRCL", for its distribution.
Value
mvp_population_summary(): a data frame with a group column
("All (n = 200)", "Males (n = 98)", ...) and one row per covariate.
mvp_population_plot(): a plot.
Examples
pop <- mvp_population(100, db = "NHANES", seed = 1,
covariates = list(CRCL = mvp_covariate("normal", mean = 100, sd = 20)))
mvp_population_summary(pop)
#> group variable Min 5% 1st Qu. Median Mean 3rd Qu. 95%
#> 1 All (n = 100) AGE (y) 18.0 20.9 36.0 45.0 44.1 55.0 61.0
#> 2 All (n = 100) WT (kg) 43.0 54.0 66.9 81.5 83.3 95.2 119.9
#> 3 All (n = 100) HT (cm) 139.3 148.3 161.1 168.0 168.1 174.9 188.5
#> 4 All (n = 100) BMI (kg/m2) 16.5 20.3 24.8 28.6 29.3 32.4 39.4
#> 5 All (n = 100) BSA (m2) 1.3 1.5 1.7 1.9 1.9 2.1 2.3
#> 6 All (n = 100) CRCL 42.0 67.6 87.8 98.3 100.0 112.3 134.1
#> 7 Males (n = 50) AGE (y) 18.0 19.9 41.0 47.0 46.4 56.0 61.5
#> 8 Males (n = 50) WT (kg) 57.4 65.5 81.8 92.3 94.8 104.9 128.4
#> 9 Males (n = 50) HT (cm) 157.0 161.9 168.4 174.7 175.3 181.8 191.8
#> 10 Males (n = 50) BMI (kg/m2) 20.1 22.7 26.5 30.5 30.9 33.0 41.7
#> 11 Males (n = 50) BSA (m2) 1.6 1.7 2.0 2.1 2.1 2.2 2.4
#> 12 Males (n = 50) CRCL 42.0 65.8 86.0 94.5 97.8 111.9 131.4
#> 13 Females (n = 50) AGE (y) 19.0 22.9 32.8 40.5 41.7 50.5 61.0
#> 14 Females (n = 50) WT (kg) 43.0 47.2 59.4 68.9 71.9 81.0 104.8
#> 15 Females (n = 50) HT (cm) 139.3 146.8 157.2 161.3 160.8 166.9 172.2
#> 16 Females (n = 50) BMI (kg/m2) 16.5 19.5 24.2 26.8 27.6 30.9 37.0
#> 17 Females (n = 50) BSA (m2) 1.3 1.4 1.6 1.7 1.7 1.9 2.1
#> 18 Females (n = 50) CRCL 54.5 70.2 89.0 100.9 102.1 112.8 134.9
#> Max CV% gMean gMean CV%
#> 1 64.0 28.3 42.0 33.5
#> 2 171.2 26.6 80.5 26.6
#> 3 196.7 6.8 167.7 6.8
#> 4 60.0 21.9 28.6 21.1
#> 5 2.6 14.5 1.9 14.7
#> 6 153.1 20.3 97.8 22.0
#> 7 64.0 26.4 44.4 33.2
#> 8 171.2 21.4 92.8 20.6
#> 9 196.7 5.4 175.1 5.4
#> 10 60.0 21.9 30.3 20.2
#> 11 2.6 10.4 2.1 10.5
#> 12 135.6 20.7 95.5 23.0
#> 13 63.0 29.7 39.8 33.1
#> 14 130.2 24.7 69.9 24.0
#> 15 174.9 5.1 160.6 5.2
#> 16 43.5 20.5 27.1 20.7
#> 17 2.4 12.6 1.7 12.4
#> 18 153.1 19.9 100.1 21.0
mvp_population_plot(pop)
mvp_population_plot(pop, "CRCL")
#> `stat_bin()` using `bins = 30`. Pick better value `binwidth`.