Description Usage Arguments Details Value Author(s) References Examples
View source: R/MeasurementPrecision.R
The measurement precision toolkit returns the value of descritive statistics rounded according to the measurement precision. If measurements are performed with a certain precision, called delta_x, then the statistics derived from those measurements cannot have more than a certain precisions, computed according to the formulas underlying those statistics. The descriptive statistics for which an expression of the precision is known are:
For univariate statistics: mean, sd (standard deviation), semean (standard error of the mean), ci (confidence interval), cohen.d (one-sample Cohen's d, d_1), var (variance), t.test (one-sample t-test);
For bivariate statistics: cohen.d (two-sample Cohen's d, d_p), meandiff (mean difference), t.test (two-sample t-test);
For multivariables: sdpool (pooled standard deviation), F.ratio (only worst-case scenario).
Three scenarios are considered:
- Extrinsinc precision: precision is estimated according to a population point of view (uses standard error of the statistic);
- Intrinsinc precision (worst-case): precision is estimated assuming systematic measurement errors and the maximal impact it can have on the statistic;
- Intrinsinc precision (best-case): precision is estimated assuming non- systematic measurement errors and the root-mean-squared impact in can have;
1 2 3 4 5 6 7 8 9 10 11 12 | roundMP.mean (fromStatistics||fromData, deltax, ...)
roundMP.sd (fromStatistics||fromData, deltax, ...)
roundMP.var (fromStatistics||fromData, deltax, ...)
roundMP.semean (fromStatistics||fromData, deltax, ...)
roundMP.cimean (fromStatistics||fromData, deltax, gamma, ...)
roundMP.cohen.d (fromStatistics||fromData, deltax, mu0, ...)
roundMP.t.test (fromStatistics||fromData, deltax, mu0, ...)
roundMP.meandiff(fromStatistics||fromData, deltax, ...)
roundMP.cohen.d (fromStatistics||fromData, deltax, ...)
roundMP.t.test (fromStatistics||fromData, deltax, ...)
roundMP.sdpool (fromStatistics||fromData, deltax, ...)
roundMP.F.ratio (fromData, deltax, ...)
|
fromStatistics |
a list of already computed statistics; use if you do not provide fromData; |
fromData |
a vector, a matrix or a dataframe containing raw data; use if you do not provide fromStatistics; |
deltax |
the precision of the instrument; |
assumptions |
boolean (TRUE to assume relevant symplifying assumptions); |
verbose |
boolean (TRUE to display a human-readable output); |
gamma |
for confidence intervals, the coverage level (default if omitted 95%); |
mu0 |
for the one-sample cohen.d and one-sample t.test, the mean of reference; |
These functions returns a summary statistic which is rounded according to the measurement's precision.
the summary statistic and its value rounded based on the measurement precision
Denis Cousineau, denis.cousineau@uottawa.ca
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | # define a vector (it could be a 1-colum matrix or a one-column data.frame)
x1 <- c(3,4,5)
# get the rounded mean assuming that the instrument is precise to +or- 1
roundMP.mean(fromData = x1, deltax = 1)
roundMP.mean(fromStatistics = list(mean = 4, sd = 1, n = 3), deltax = 1, verbose = TRUE)
# get the rounded standard error, the rounded confidence intervals
roundMP.semean(fromData = x1, deltax = 1)
roundMP.cimean(fromData = x1, deltax = 1)
# get the rounded mean difference between two vectors;
x2 <- c(5,7,9)
roundMP.meandiff(fromData = cbind(x1,x2), deltax = 1)
# get the rounded F ratio, the rounded Cohen's d, and the rounded t-test
# for the last, do not assume symplifiying assumptions
roundMP.F.ratio(fromData = cbind(x1,x2), deltax = 1)
roundMP.cohen.d(fromData = cbind(x1,x2), deltax = 1)
roundMP.t.test( fromData = cbind(x1,x2), deltax = 1, assumptions = FALSE)
# The t.test function also works with a t.test object
# produced by the t.test function (i.e., with var.equal=T option)
res <- t.test(x1, x2, var.equal = T)
roundMP.t.test(fromObject = res, deltax = 1)
# The F ratio and the pooled standard deviation take any number of columns
x3 <- c(2,5,9,11,25)
roundMP.sdpool( fromData = list(x1,x2,x3), deltax = 1)
roundMP.F.ratio(fromData = list(x1,x2,x3), deltax = 1)
# the F ratio only works with fromData.
# By default, all four scenarios are displayed.
# You can restrict the scenarios displayed with the option
# roundMP.selectedScenario to a sublist of the followings:
# "machine.precision", "extrinsic", "systematic", "non.systematic"
options(roundMP.selectedScenario = c("machine.precision","non.systematic"))
roundMP.t.test( fromData = cbind(x1,x2), deltax = 1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.