TwoKids | R Documentation |
The number of boys in a sample of 2,444 two-child families.
A data frame with 3 observations on the following 2 variables.
a numeric vector
a numeric vector
Rodgers, J.L. and D. Doughty. 2001. Does having boys or girls run in the family? Chance Magazine Fall 2001: 8-13.
http://www.dartmouth.edu/~chance/chance_news/recent_news/chance_news_10.11.html#item13
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.