percent.r: percent change to r

percent.rR Documentation

percent change to r

Description

percent change derived from transformed exponentiated regression coefficients and confidence interval to correlation coefficient
percent change and ci -> expnentiated b and ci -> t -> r
unadjusted t-statistics estimate bivariate correlation coefficient (enter k = 1)
adjusted t-statistics (e.g., from a regression) estimate partial correlation coefficient (aloe & thompson, 2013).

Usage

percent.r(percent, cil, ciu, n, k, result = c("cil", "ciu", "avg"))

Arguments

percent

the percent change calculated from exponentiated logistic regression coefficient
specifically computed such that percent change = 100*(exp(b) - 1); where b is the regression coefficient
if percent change expressed in decimals, please *100 first
or if percent change not computed with above equation, please compute back to exponentiated b and then use expb.r()

cil

the lower bound of the confidence interval around the percent change

ciu

the upper bound of the confidence interval around the percent change

n

the sample size

k

the total number of predictors, enter k = 1 if bivariate

result

one of the following:

  • "ciu" uses the upper bound of ci to compute se (defaults if missing input)

  • "cil" uses the lower bound of ci to compute se

  • "avg" uses both upper bound and lower bound and then take the average of the resulting se's

Examples

percent.r(7, 3, 11, 3134, 6)
dat %>% mutate (r_from_perc = percent.r(percent, percent_lowerci, percent_upperci, percent_n, percent_predictors)) -> dat


phoebehlam/michaela documentation built on Oct. 23, 2024, 4:10 p.m.