Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

TwoKids

Number of Boys in Two-Child Families


Description

The number of boys in a sample of 2,444 two-child families.

Format

A data frame with 3 observations on the following 2 variables.

num.boys

a numeric vector

count

a numeric vector

Source

Rodgers, J.L. and D. Doughty. 2001. Does having boys or girls run in the family? Chance Magazine Fall 2001: 8-13.

References

Examples

TwoKids
observed <- TwoKids$count
expected <- c(585.3, 1221.4, 637.3)
chisq.test(observed, p = expected, rescale.p = TRUE)

# Alternate calculation, using Pr[male] = 0.512
# and rbinom. See Figure 5.7-1
n <- sum(observed)
pr.m <- 0.512
pr.f <- 0.488

# Calculate the probabilities of 0, 1, and 2 males
(pr.0 <- pr.f^2)
(pr.1 <- pr.m * pr.f + pr.f * pr.m)
(pr.2 <- pr.m^2)

set.seed(1)
(expected2 <- c(rbinom(1, n, pr.0),
                rbinom(1, n, pr.1),
                rbinom(1, n, pr.2)))
chisq.test(observed, p = expected2, rescale.p = TRUE)

abd

The Analysis of Biological Data

v0.2-8
GPL-2
Authors
Kevin M. Middleton <middletonk@missouri.edu>, Randall Pruim <rpruim@calvin.edu>
Initial release
2015-07-02

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.