peas {multibridge}R Documentation

Mendelian Laws of Inheritance

Description

This data set, "peas", provides the categorization of crossbreeds between a plant variety that produced round yellow peas with a plant variety that produced wrinkled green peas. This data set contains the categorization of 556 plants that were categorized either as (1) round and yellow, (2) wrinkled and yellow, (3) round and green, or (4) wrinkled and green.

Usage

data(peas)

Format

A data.frame with 4 rows and 2 variables:

peas

Crossbreeds that are categorized as 'roundYellow', 'wrinkledYellow', 'roundGreen', or 'wrinkledGreen'.

counts

The number of plants assigned to a one of the crossbreed categories.

References

Mulder J, Wagenmakers E, Marsman M (in press). “A Generalization of the Savage-Dickey Density Ratio for Testing Equality and Order Constrained Hypotheses.” The American Statistician.

Robertson T (1978). “Testing for and against an order restriction on multinomial parameters.” Journal of the American Statistical Association, 73, 197–202.

Sarafoglou A, Haaf JM, Ly A, Gronau QF, Wagenmakers EJ, Marsman M (2021). “Evaluating Multinomial Order Restrictions with Bridge Sampling.” Psychological Methods.

Examples

data("peas")
# Prior specification 
# We assign a uniform Dirichlet distribution, that is, we set all 
# concentration parameters to 1
a <- c(1, 1, 1, 1)     

x <- peas$counts
factor_levels <- levels(peas$peas)
# Test the following mixed Hypothesis:
# Hr: roundYellow > wrinkledYellow = roundGreen > wrinkledGreen 
#
# Be careful: Factor levels are usually ordered alphabetically!
# When specifying hypotheses using indexes, make sure they refer to the 
# correct factor levels.
Hr <- c('1 > 2 = 3 > 4') 
# To avoid mistakes, write out factor levels explicitly:
Hr <- c('roundYellow > wrinkledYellow = roundGreen > wrinkledGreen')

out <- mult_bf_informed(x=x, Hr=Hr, a=a, factor_levels=factor_levels, niter=2e3,
bf_type = 'BFre')
summary(out)

[Package multibridge version 1.2.0 Index]