A: A

Description Usage Arguments Value Author(s) References Examples

View source: R/A.R

Description

Calculates probability of superiority (A), its standard error, and a confidence interval.

Usage

1
2
3
A(data, design = 1, statistic = 1, weights = FALSE,
w = 0, w1 = 0, w2 = 0, increase = FALSE, ref = 1, r = 0,
n.bootstrap = 1999, conf.level = .95, ci.method = 1, seed = 1)

Arguments

data

For a between subjects design, a matrix of cases (rows) by scores (column 1) and group codes (column 2). For a within subjects design, a matrix of scores with each sample in its own column (matrix).

design

Design of experiment (scalar, default = 1 (for between subjects design), user can also call 2 (for within subjects design)).

statistic

Statistic to be calculated (scalar, default = 1 (A), user can also call 2 (A.AAD), 3 (A.AAPD), 4 (A.IK), or 5 (A.Ord)).

weights

Whether to assign weights to cases (default = FALSE); if set to TRUE, data contains case weights in final column.

w

Weights for cases (vector; default = 0).

w1

Weights for cases in group 1 (vector; default = 0).

w2

Weights for cases in group 2 (vector; default = 0).

increase

Set to TRUE if scores are predicted to increase with group codes (default = FALSE).

ref

Reference group (to compare to all others) (scalar, default = 1).

r

Vector of proportions (vector, default = 0, represents equal proportions).

n.bootstrap

Number of bootstrap samples (scalar, default = 1999).

conf.level

Confidence level (default = .95).

ci.method

Method used to construct confidence interval (scalar, default = 1 (for BCA), user can also call 2 (for percentile)).

seed

Random number seed (scalar, default = 1).

Value

Returns list object with the following elements: A : A statistic (scalar). SE : Standard error of A (scalar). ci.lower : Lower bound of confidence interval (scalar). ci.upper : Upper bound of confidence interval (scalar). conf.level : Confidence level (scalar). n.bootstrap : Number of bootstrap samples (scalar). boot.method : Bootstrap method ("BCA" or "percentile"). n : Sample size (after missing data removed; scalar). n.missing : Number of cases of missing data, removed listewise (scalar).

Author(s)

John Ruscio

References

Ruscio (2008) & Ruscio and Mullen (2012) & Ruscio and Gera (2013)

Examples

1
2
3
4
5
x1 <- rnorm(25)
x2 <- x1 - rnorm(25, mean = 1)
x3 <- x2 - rnorm(25, mean = 1)
data <- cbind(c(x1, x2, x3), c(rep(1, 25), rep(2, 25), rep(3, 25)))
A(data, 1, 2)

Example output

$A
[1] 0.6749333

$SE
[1] 0.03284302

$ci.lower
[1] 0.5826667

$ci.upper
[1] 0.7234667

$conf.level
[1] 0.95

$n.bootstrap
[1] 1999

$boot.method
[1] "BCA"

$n
[1] 75

$n.missing
[1] 0

RProbSup documentation built on Jan. 13, 2021, 10:41 p.m.

Related to A in RProbSup...