csSensitivity: Sensitivity analysis for the Bayes Factors of 'csCompare'...

Description Usage Arguments Details Value References See Also Examples

View source: R/csSensitivity.R

Description

Perform a sensitivity analysis for the Bayes factors computed with the csCompare results

Usage

1
2
3
csSensitivity(cs1, cs2, group = NULL, data = NULL,
  alternative = "two.sided", conf.level = 0.95, mu = 0,
  rscaleSens = c(0.707, 1, 1.41), out.thres = 3)

Arguments

cs1

a numeric vector of values. If the data argument is defined, it can refer to either the column index or the column name of the data object. See Details for more information.

cs2

a numeric vector of values. If the data argument is defined, it can refer to either the column index or the column name of the data object. See Details for more information.

group

column index or name that contain the group data. See Details for more information.

data

numeric matrix or data frame that contains the relevant data.

alternative

a character string for the speficication of the alternative hypothesis. Possible values: "two.sided" (default), "greater" or "less".

conf.level

Interval's confidence level.

mu

a numeric value for the mean value or mean difference.

rscaleSens

the scale factor for the prior used in the Bayesian t.test

out.thres

The threeshold for detecting outliers (default is 3). If set to 0, no outliers analysis will be performed. See Details below for more information.

Details

csCompare performs both a student t-test (using the stats::t.test function) and a Bayesian t-test (using the BayesFactor::ttest.tstat). In case group is not defined, paired-samples t-tests are run. In case the group is defined, then the csCompare first computes difference scores between the cs1 and the cs2 (i.e., cs1 - cs2). In case the group argument is defined but, after removal of NA's (stats::na.omit), only one group is defined, a paired samples t-test is run.

Value

The function returns a data frame with the results of the student t-test and the Bayesian t-test.

References

Krypotos, A.-M., Klugkist, I., & Engelhard, I. M. (submitted).Bayesian Hypothesis Testing for Human Threat Conditioning Research: An introduction and the condir R package.

See Also

csCompare, t.test, ttest.tstat

Examples

1
2
csSensitivity(cs1 = rnorm(n = 100, mean = 10),
cs2 = rnorm(n = 100, mean = 9))

Example output

$res
  nG1 nG2  LNI HNI rscale             bf10                 bf01
1 100   0 -Inf Inf  0.707  152280.43894693 6.56683160959696e-06
2 100   0 -Inf Inf      1 133811.798158648 7.47318258749046e-06
3 100   0 -Inf Inf   1.41 108311.773308038 9.23260666369121e-06
             propError
1 4.13379341314346e-13
2 5.36893792303131e-13
3 6.66259839102413e-13

attr(,"class")
[1] "csSensitivity"

condir documentation built on May 29, 2017, 7:54 p.m.