cmp_sdim_coefs: Standard deviation independent of mean

Description Usage Arguments Value Note Examples

View source: R/compute_sdim.R

Description

Standard deviation independent of mean

Usage

1
2
3
cmp_sdim_coefs(bp_mean, bp_sd)

cmp_sdim_values(bp_mean, bp_sd)

Arguments

bp_mean

a numeric vector of mean blood pressure values.

bp_sd

a numeric vector of standard deviations corresponding to the mean blood pressure values.

Value

cmp_sdim_coefs returns the regression coefficients from a linear model fitted to the log-transformed values of bp_mean and bp_sd (i.e., coef(lm(log_sd ~ log_mean))). cmp_sdim_values uses the regression coefficients form cmp_sdim_coefs to compute the standard deviation of blood pressure independent from the mean.

Note

SDIM (standard deviation independent of the mean) is cohort-specific. So, if you remove a participant from the study, it will result in a new value of SDIM for everyone else.

Examples

1
2
3
4
mean_bps = runif(n = 100, min = 80, max = 190)
sd_bps   = runif(n = 100, min = 1, max = 3)
cmp_sdim_coefs(mean_bps, sd_bps)
cmp_sdim_values(mean_bps, sd_bps)

bcjaeger/cleanRbp documentation built on May 26, 2021, 1:03 p.m.