prop.bin.multcomp {RVAideMemoire}R Documentation

Pairwise comparisons after a test for given probabilities

Description

Performs pairwise comparisons after a global test for given response probabilities (i.e. when the response variable is a binary variable), by using exact binomial tests. The function is in fact a wrapper to pairwise comparisons of proportions to given values on a contingency table.

Usage

prop.bin.multcomp(formula, data, p, p.method = "fdr")

Arguments

formula

a formula of the form a ~ b, where a and b give the data values and corresponding groups, respectively. a can be a numeric vector or a factor, with only two possible values (except NA).

data

an optional data frame containing the variables in the formula formula. By default the variables are taken from environment(formula).

p

theoretical probabilities.

p.method

method for p-values correction. See help of p.adjust.

Details

If the response is a 0/1 variable, the probability of the '1' group is tested. In any other cases, the response is transformed into a factor and the probability of the second level is tested.

Value

method

name of the test.

data.name

a character string giving the name(s) of the data.

observed

observed probabilities.

expected

expected probabilities.

p.adjust.method

method for p-values correction.

p.value2

corrected p-values.

p.value

table or results of pairwise comparisons.

Author(s)

Maxime HERVE <maxime.herve@univ-rennes1.fr>

See Also

prop.multcomp, chisq.theo.bintest

Examples

response <- c(rep(0:1,c(40,60)),rep(0:1,c(55,45)),rep(0:1,c(65,35)))
fact <- gl(3,100,labels=LETTERS[1:3])
p.theo <- c(0.5,0.45,0.2)
chisq.theo.bintest(response~fact,p=p.theo)
prop.bin.multcomp(response~fact,p=p.theo)

[Package RVAideMemoire version 0.9-83-7 Index]