Learn R Programming

sensR (version 1.5-2)

posthoc: Post-hoc estimates and tests for multiple discrimination experiments.

Description

This function provides estimates and p-values for post-hoc tests such as pairwise comparisons. p-values are (by default) adjusted for multiplicity.

Usage

posthoc(x, ...)

# S3 method for dprime_compare posthoc(x, alpha = 0.05, test = c("pairwise", "common", "base", "zero"), base = 1, alternative = c("two.sided", "less", "greater"), statistic = c("likelihood", "Wald"), padj.method = c("holm", "bonferroni", "none"), ...)

# S3 method for dprime_test posthoc(x, alpha = 0.05, test = c("pairwise", "common", "base", "zero"), base = 1, alternative = c("two.sided", "less", "greater"), statistic = c("likelihood", "Wald"), padj.method = c("holm", "bonferroni", "none"), ...)

Arguments

x

an object of class dprime_compare or dprime_test.

alpha

the significance level for tests and confidence intervals.

test

the type of post-hoc tests performed. Se the details section for further details.

base

when test = "base", the experiment against which to provide pairwise comparisons.

alternative

direction of the hypothesis test.

statistic

The test statistic used - currently there is only partial support for statistic = "likelihood".

padj.method

controls the method by which p-values are adjusted for multiplicity. Any one of the values in p.adjust.methods (currently "holm" "hochberg" "hommel" "bonferroni" "BH" "BY" "fdr" "none") may be specified, cf. p.adjust.

…

currently not used.

Value

an object of class c(paste0("posthoc.", class(x)), class(x)) with the following elements from the original object, x and :

posthoc

coefficient table for the post-hoc tests.

test

the value of the test argument.

alternative

the value of the alternative argument.

padj.method

the method used to adjust p-values with.

base

the value of the base argument.

posthoc.stat

name of the statistic for the post-hoc tests.

Letters

if test = "pairwise" the compact letter display, otherwise NULL.

dprime0

unless test = "pairwise" or "common" the value of d-prime under the null hypothesis.

Details

The test argument specifies the type of test performed. "pairwise" performs all pairwise comparisons and produces a compact letter display indicating groups of experiments that different/not-different. "common" tests, for each experiment in turn, if the by-experiment d-prime is different from a common d-prime computed from the remaining experiments. "base" provides pairwise comparisons to a single experiment indicated by the separate argument base. If test = "zero" all d-primes are tested versus zero. As a final option a numeric value can be supplied, e.g. test = 1 in which case all d-primes are tested versus one. Note that test = 0 gives the same test as test = "zero".

When test = "pairwise" a compact letter display is provided and it is determined from the p-values after adjustment of these for multiplicity.

The dprime_compare and dprime_test methods a have (common) print method.

See Also

dprime_test, dprime_table, dprime_compare.

Examples

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

posthoc(dpc, alpha=.1) ## test="pairwise"

## Test if each d' is different from the common d' estimated from the
## remaining experiments:
posthoc(dpc, test="common")

## Test if d' from experiment 2 is different from the others (with
## adjustment for multiplicity):
posthoc(dpc, test="base", base=2)

## Test if each d' is different from 2 (with Bonferroni adjustment for
## multiplicity) using the Wald statistic:
posthoc(dpc, test=2, stat="Wald", padj.method="bonferroni")

# }

Run the code above in your browser using DataLab