Learn R Programming

coin (version 1.4-4)

malformations: Maternal Drinking and Congenital Sex Organ Malformation

Description

A subset of data from a study on the relationship between maternal alcohol consumption and congenital malformations.

Usage

malformations

Arguments

Format

A data frame with 32574 observations on 2 variables.

consumption

alcohol consumption, an ordered factor with levels "0", "<1", "1-2", "3-5" and ">=6".

malformation

congenital sex organ malformation, a factor with levels "Present" and "Absent".

Details

Data from a prospective study undertaken to determine whether moderate or light drinking during the first trimester of pregnancy increases the risk for congenital malformations coin::Mills+Graubard:1987. The subset given here concerns only sex organ malformation |coin::Mills+Graubard:1987|Tab. 4.

This data set was used by coin::graubard_1987 to illustrate that different choices of scores for ordinal variables can lead to conflicting conclusions. coin::zheng:2008 also used the data, demonstrating two different score-independent tests for ordered categorical data; see also coin::winell_2018.

References

*

Examples

Run this code
## Graubard and Korn (1987, Tab. 3)

## One-sided approximative (Monte Carlo) Cochran-Armitage test
## Note: midpoint scores (p < 0.05)
midpoints <- c(0, 0.5, 1.5, 4.0, 7.0)
chisq_test(malformation ~ consumption, data = malformations,
           distribution = approximate(nresample = 1000),
           alternative = "greater",
           scores = list(consumption = midpoints))

## One-sided approximative (Monte Carlo) Cochran-Armitage test
## Note: midrank scores (p > 0.05)
midranks <- c(8557.5, 24375.5, 32013.0, 32473.0, 32555.5)
chisq_test(malformation ~ consumption, data = malformations,
           distribution = approximate(nresample = 1000),
           alternative = "greater",
           scores = list(consumption = midranks))

## One-sided approximative (Monte Carlo) Cochran-Armitage test
## Note: equally spaced scores (p > 0.05)
chisq_test(malformation ~ consumption, data = malformations,
           distribution = approximate(nresample = 1000),
           alternative = "greater")

if (FALSE) {
## One-sided approximative (Monte Carlo) score-independent test
## Winell and Lindbaeck (2018)
(it <- independence_test(malformation ~ consumption, data = malformations,
                         distribution = approximate(nresample = 1000,
                                                    parallel = "snow",
                                                    ncpus = 8),
                         alternative = "greater",
                         xtrafo = function(data)
                             trafo(data, ordered_trafo = zheng_trafo)))

## Extract the "best" set of scores
ss <- statistic(it, type = "standardized")
idx <- which(ss == max(ss), arr.ind = TRUE)
ss[idx[1], idx[2], drop = FALSE]}

Run the code above in your browser using DataLab