dprime_compare: Test the 'any-differences' hypothesis and estimate common...

View source: R/d.primeTest.R

dprime_compareR Documentation

Test the 'any-differences' hypothesis and estimate common d-prime

Description

This function will test the 'any-differences' hypothesis (conceptually a one-way ANOVA test for d-primes) with one of the Wald, Pearson or likelihood ratio chi-square test statistics. The common d-prime is estimated with ML or weighted average.

Usage

dprime_compare(correct, total, protocol, conf.level = 0.95,
   statistic = c("likelihood", "Pearson", "Wald.p", "Wald.d"),
   estim = c("ML", "weighted.avg"))

Arguments

correct

a numeric vector of the number of correct answers; one element for each test.

total

a numeric vector of the total number of trials; one element for each test.

protocol

a character vector or factor naming the protocol used; one element for each test. Currently the following protocols are supported: "triangle", "duotrio", "threeAFC", "twoAFC", "tetrad".

conf.level

the confidence level for the estimated common d-prime.

statistic

the test statistic for testing the 'any-differences' hypothesis.

estim

The estimation method for the common d-prime.

Details

The vectors correct, total and protocol have to be of the same length.

The function has a print method.

Value

an object of class "dprime_compare" with the following elements

stat.value

the value of the (chi-square) test statistic for the 'any-differences' hypothesis.

df

the degrees of freedom for the stat.value test statistic.

p.value

the p-value for the 'any-differences' test.

statistic

the name of the test statistic for the 'any-differences' test.

data

the data table produced by dprime_table.

coefficients

'table' with estimated common d-prime, standard error and confidence limits storred as a one-row data.frame.

conf.level

confidence level for the common d-prime.

conf.int

the confidence interval for the common d-prime.

estim

the estimation method for the common d-prime.

conf.method

the statistical method/test statistic used to compute the confidence interval for the common d-prime.

Author(s)

Rune Haubo B Christensen

See Also

dprime_test, dprime_table, posthoc.dprime_compare.

Examples


## Make some fake data:
n <- rep(40, 4)
x <- c(25, 25, 30, 35)
protocol <- c("triangle", "duotrio", "threeAFC", "twoAFC")
## Look at the data table with d-primes etc.:
dprime_table(x, n, protocol)

## 'any differences' test:
## ML estimation and test with likelihood statistic:
(dpc <- dprime_compare(x, n, protocol))
## Other estimation/statistic options:
dprime_compare(x, n, protocol, estim="weighted.avg")
dprime_compare(x, n, protocol, statistic="Pearson")
dprime_compare(x, n, protocol, statistic="Wald.p")
dprime_compare(x, n, protocol, statistic="Wald.d")


sensR documentation built on Nov. 2, 2023, 6:02 p.m.