Learn R Programming

sensR (version 1.5-2)

dprime_test: Test of simple hypothesis with the common d-prime

Description

This function tests the hypothesis that the common d-prime is equal to or greater/less than a certain value, e.g. zero in a Wald or likelihood root test.

Usage

dprime_test(correct, total, protocol, conf.level = 0.95, dprime0 = 0,
    statistic = c("likelihood", "Wald"),
    alternative = c("difference", "similarity", "two.sided", "less", "greater"),
    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 confidence interval of the estimated common d-prime.

dprime0

Value of d-prime under the Null hypothesis. Non-negative numeric scalar.

statistic

the test statistic for computing the confidence interval as well as p-value.

alternative

the direction of the hypothesis test. "difference" and "similarity" are just alternative ways of specifying "greater" and "less" respectively.

estim

The estimation method for the common d-prime.

Value

an object of class "dprime_test" with the following elements

p.value

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

alternative

character naming the direction of the hypothesis test.

%% \item{res.dExp}{ %% a list with \code{dExp}, the estimated common d-prime; %% \code{se.dExp} standard error of the common and if \code{estim="ML"} %% \code{nll.dExp} %% }
statistic

the name of the test statistic.

data

the data table produced by dprime_table.

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.

Details

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

The function has a print method.

See Also

dprime_compare, dprime_table, posthoc.dprime_compare.

Examples

Run this code
# NOT RUN {
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)

## Test of common d':
dprime_test(x, n, protocol)

## Another setting:
dprime_test(x, n, protocol, dprime0=2, statistic="Wald",
            alternative="less", estim="weighted.avg")

# }

Run the code above in your browser using DataLab