Title: | Magnitude-Based Inferences |
---|---|
Description: | Allows practitioners and researchers a wholesale approach for deriving magnitude-based inferences from raw data. A major goal of 'mbir' is to programmatically detect appropriate statistical tests to run in lieu of relying on practitioners to determine correct stepwise procedures independently. |
Authors: | Kyle Peterson [aut, cre], Aaron Caldwell [aut] |
Maintainer: | Kyle Peterson <[email protected]> |
License: | GPL-2 |
Version: | 1.3.5 |
Built: | 2024-10-31 05:51:16 UTC |
Source: | https://github.com/cran/mbir |
Estimates sample size for paired or independent, two-sample study desings via Accuracy in Parameter Estimation. Calculates n so a given study is likely to obtain margin of error no larger than chosen target margin of error.
aipe_smd(moe, paired = c(TRUE, FALSE), conf.int, assur.lvl, r)
aipe_smd(moe, paired = c(TRUE, FALSE), conf.int, assur.lvl, r)
moe |
target margin of error in standard deviation units |
paired |
(character) logical indicator specifying if |
conf.int |
(optional) confidence level of the interval. Defaults to |
assur.lvl |
(optional) desired level of assurance (percent experiments whose MOE is less than target MOE). Defaults to |
r |
(required if |
Refer to vignette for further information.
Maxwell SE, Kelley K & Rausch JR. (2008). Sample size planning for statistical power and accuracy in parameter estimation. Annual Review of Psychology, 59, 537-563.
Kelley K & Rausch JR. (2006). Sample size planning for the standardized mean difference: Accuracy in parameter estimation via narrow confidence intervals. Psychological Methods, 11, 363–385.
aipe_smd(moe = 0.55, paired = TRUE, conf.int = .9, assur.lvl = .99, r = 0.75)
aipe_smd(moe = 0.55, paired = TRUE, conf.int = .9, assur.lvl = .99, r = 0.75)
Provides nonparametric confidence intervals via percentile-based resampling.
boot_test(x, y, conf.int, resample, med)
boot_test(x, y, conf.int, resample, med)
x , y
|
numeric vectors of data values |
conf.int |
(optional) confidence level of the interval. Defaults to |
resample |
(optional) number of resamples. Defaults to 10,000 |
med |
(optional) number indicating true difference in medians to test against. Defaults to zero. |
Refer to vignette for further information.
require(graphics) a <- rnorm(25, 80, 35) b <- rnorm(25, 100, 50) boot_test(a, b, 0.95, 10000)
require(graphics) a <- rnorm(25, 80, 35) b <- rnorm(25, 100, 50) boot_test(a, b, 0.95, 10000)
Provides magnitude-based inferences upon given r value and sample size. Based upon WG Hopkins Microsoft Excel spreadsheet.
corr(r, n, conf.int = 0.9, swc = 0.1, plot = FALSE)
corr(r, n, conf.int = 0.9, swc = 0.1, plot = FALSE)
r |
correlation coefficient |
n |
sample size |
conf.int |
(optional) confidence level of the interval. Defaults to |
swc |
(optional) number indicating smallest worthwhile change. Defaults to |
plot |
(optional) logical indicator specifying to print associated plot. Defaults to |
Refer to vignette for further information.
Hopkins WG. (2007). A spreadsheet for deriving a confidence interval, mechanistic inference and clinical inference from a p value. Sportscience 11, 16-20. sportsci.org/2007/wghinf.htm
corr(.40, 25, 0.95)
corr(.40, 25, 0.95)
Provides statistical inference upon the difference between two independent correlations.
corr_diff(r1, n1, r2, n2, conf.int = 0.9, plot = FALSE)
corr_diff(r1, n1, r2, n2, conf.int = 0.9, plot = FALSE)
r1 |
correlation of group 1 |
n1 |
sample size of group 1 |
r2 |
correlation of group 2 |
n2 |
sample size of group 2 |
conf.int |
(optional) confidence level of the interval. Defaults to |
plot |
(optional) logical indicator specifying to print associated plot. Defaults to |
Refer to vignette for further information.
Zou GY. (2007). Toward using confidence intervals to compare correlations. Psychological Methods, 12, 399-413.
corr_diff(r1 = 0.20, n1 = 71, r2 = 0.55, n2 = 46)
corr_diff(r1 = 0.20, n1 = 71, r2 = 0.55, n2 = 46)
Provides magnitude-based inferences for the association between given data vectors. Evaluates normality assumption, performs either Pearson or Spearman correlation and subsequently estimates magnitude-based inferences.
corr_test(x, y, conf.int = 0.9, auto = TRUE, method = "pearson", swc = 0.1, plot = FALSE)
corr_test(x, y, conf.int = 0.9, auto = TRUE, method = "pearson", swc = 0.1, plot = FALSE)
x , y
|
numeric vectors of data values |
conf.int |
(optional) confidence level of the interval. Defaults to |
auto |
(character) logical indicator specifying if user wants function to programmatically detect statistical procedures. Defaults to |
method |
(character) if |
swc |
(optional) number indicating smallest worthwhile change. Defaults to |
plot |
(optional) logical indicator specifying to print associated plot. Defaults to |
Refer to vignette for further information.
Associated effect size measure, r, and respective confidence intervals.
a <- rnorm(25, 80, 35) b <- rnorm(25, 100, 35) corr_test(a, b, 0.95)
a <- rnorm(25, 80, 35) b <- rnorm(25, 100, 35) corr_test(a, b, 0.95)
Converts between equivalent effect size measures: d, r, odds ratio.
es_convert(x, from = c("d", "or", "r"), to = c("d", "or", "r"))
es_convert(x, from = c("d", "or", "r"), to = c("d", "or", "r"))
x |
numeric value |
from |
(character) current effect size of |
to |
(character) effect size measure to convert to |
Refer to vignette for further information.
Rosenthal R. (1994). Parametric measures of effect size. In H. Cooper & LV. Hedges (Eds.), The Handbook of Research Synthesis. New York, NY: Sage.
Borenstein M, Hedges LV, Higgins JPT & Rothstein HR. (2009). Introduction to Meta-Analysis. Chichester, West Sussex, UK: Wiley.
# Odds ratio to Cohen's d es_convert(1.25, from = "or", to = "d")
# Odds ratio to Cohen's d es_convert(1.25, from = "or", to = "d")
Provides magnitude-based inferences upon given odds ratio and p-value. Based upon WG Hopkins Microsoft Excel spreadsheet.
odds(or, p, conf.int = 0.9)
odds(or, p, conf.int = 0.9)
or |
odds ratio |
p |
associated p-value |
conf.int |
(optional) confidence level of the interval. Defaults to |
Refer to vignette for further information.
Hopkins WG. (2007). A spreadsheet for deriving a confidence interval, mechanistic inference and clinical inference from a p value. Sportscience 11, 16-20. sportsci.org/2007/wghinf.htm
odds(1.25, 0.06, 0.95)
odds(1.25, 0.06, 0.95)
Provides magnitude-based inferences upon given proportions and sample sizes. Based upon WG Hopkins Microsoft Excel spreadsheet.
prop(p1, n1, p2, n2, conf.int)
prop(p1, n1, p2, n2, conf.int)
p1 |
proportion of group 1 |
n1 |
sample size of group 1 |
p2 |
proportion of group 2 |
n2 |
sample size of group 2 |
conf.int |
(optional) confidence level of the interval. Defaults to |
Refer to vignette for further information.
Hopkins WG. (2007). A spreadsheet for deriving a confidence interval, mechanistic inference and clinical inference from a p value. Sportscience 11, 16-20. sportsci.org/2007/wghinf.htm
prop(p1 = 0.7, n1 = 25, p2 = 0.5, n2 = 20)
prop(p1 = 0.7, n1 = 25, p2 = 0.5, n2 = 20)
Provides magnitude-based inferences upon given d, p-value, and degrees of freedom. Based upon WG Hopkins Microsoft Excel spreadsheet.
smd(es, p, df, conf.int = 0.9, swc = 0.5, plot = FALSE)
smd(es, p, df, conf.int = 0.9, swc = 0.5, plot = FALSE)
es |
effect size measure (Cohen's d) |
p |
associated p-value from t-statistic |
df |
associated degrees of freedom from t-statistic |
conf.int |
(optional) confidence level of the interval. Defaults to |
swc |
(optional) number indicating smallest worthwhile change. Defaults to |
plot |
(optional) logical indicator specifying to print associated plot. Defaults to |
Refer to vignette for further information.
Hopkins WG. (2007). A spreadsheet for deriving a confidence interval, mechanistic inference and clinical inference from a p value. Sportscience 11, 16-20. sportsci.org/2007/wghinf.htm
smd(.75, 0.06, 20, 0.95)
smd(.75, 0.06, 20, 0.95)
Performs two-sample difference of means analysis to produce magnitude-based inferences. Evaluates both normality and homogeneity, performs either t-test or wilcoxon test, computes effect sizes and estimates magnitude-based inferences. Allows both independent and paired designs.
smd_test(x, y, paired = c(TRUE, FALSE), auto = TRUE, var = TRUE, normal = TRUE, conf.int = 0.9, mu = 0, swc = 0.5, plot = FALSE)
smd_test(x, y, paired = c(TRUE, FALSE), auto = TRUE, var = TRUE, normal = TRUE, conf.int = 0.9, mu = 0, swc = 0.5, plot = FALSE)
x , y
|
numeric vectors of data values |
paired |
(character) logical indicator specifying if |
auto |
(character) logical indicator specifying if user wants function to programmatically detect statistical procedures. Defaults to |
var |
(optional) if |
normal |
(optional) if |
conf.int |
(optional) confidence level of the interval. Defaults to |
mu |
(optional) number indicating true difference in means to test against. Defaults to zero. |
swc |
(optional) number indicating smallest worthwhile change. Defaults to |
plot |
(optional) logical indicator specifying to print associated plot. Defaults to |
Refer to vignette for further information.
Associated effect size measures (d, r, odds ratio) and respective confidence intervals based upon which statistical test(s) performed.
a <- rnorm(25, 80, 35) b <- rnorm(25, 100, 50) smd_test(a, b, paired = FALSE, conf.int=0.95)
a <- rnorm(25, 80, 35) b <- rnorm(25, 100, 50) smd_test(a, b, paired = FALSE, conf.int=0.95)
Estimates magnitude-based inferences upon planned sample size and r value. Based upon WG Hopkins Microsoft Excel spreadsheet.
ss_corr(n, r)
ss_corr(n, r)
n |
planned sample size |
r |
planned correlation coefficient |
Refer to vignette for further information.
Hopkins WG. (2006). Estimating sample size for magnitude-based inferences. Sportscience 10, 63-70. sportsci.org/2006/wghss.htm
ss_corr(n = 20, r = 0.2)
ss_corr(n = 20, r = 0.2)
Estimates magnitude-based inferences upon planned sample size and odds ratio. Based upon WG Hopkins Microsoft Excel spreadsheet.
ss_odds(exp, con, or)
ss_odds(exp, con, or)
exp |
planned sample size of experimental group |
con |
planned sample size of control group |
or |
planned odds ratio |
Refer to vignette for further information.
Hopkins WG. (2006). Estimating sample size for magnitude-based inferences. Sportscience 10, 63-70. sportsci.org/2006/wghss.htm
ss_odds(exp = 15, con = 18, or = 3.25)
ss_odds(exp = 15, con = 18, or = 3.25)
Estimates magnitude-based inferences upon planned sample size and d value. Based upon WG Hopkins Microsoft Excel spreadsheet.
ss_smd(exp, con, es)
ss_smd(exp, con, es)
exp |
planned sample size of experimental group |
con |
planned sample size of control group |
es |
planned Cohen's d |
Refer to vignette for further information.
Hopkins WG. (2006). Estimating sample size for magnitude-based inferences. Sportscience 10, 63-70. sportsci.org/2006/wghss.htm
ss_smd(exp = 20, con = 15, es = 0.6)
ss_smd(exp = 20, con = 15, es = 0.6)
Provides longitudinal magnitude-based inferences for an individual's change from previous time point and magnitude of deviation from trend line.
swc_ind(x, swc, type = c("previous", "trend"), ts, te, main, xlab, ylab)
swc_ind(x, swc, type = c("previous", "trend"), ts, te, main, xlab, ylab)
x |
numeric vectors of data values |
swc |
smallest worthwhile change |
type |
(character) indicator specifying which type of analysis: "previous" or "trend" |
ts |
(required if |
te |
(optional) typical error. Defaults to typical error of the estimate |
main |
(optional) plot title. Defaults to blank |
xlab |
(optional) x-axis label. Defaults to "Measurement" |
ylab |
(optional) y-axis label. Defaults to name of |
Refer to vignette for further information.
Hopkins WG. (2017). A spreadsheet for monitoring an individual's changes and trend. Sportscience 21, 5-9. sportsci.org/2017/wghtrend.htm
df<-c(97.5,99.9,100.2,101,101.2,99.8) swc_ind(x = df, swc = 0.5, te = 1, ts = 0.25, type = "trend")
df<-c(97.5,99.9,100.2,101,101.2,99.8) swc_ind(x = df, swc = 0.5, te = 1, ts = 0.25, type = "trend")