sexRatioTest: Sex Ratio Test

View source: R/sexRatioTest.R

sexRatioTestR Documentation

Sex Ratio Test

Description

Sex Ratio Test

Usage

sexRatioTest(sex, codes = c(1, 2), pop = c(1, 1))

Arguments

sex

A vector of values that indicate sex

codes

Codes used to identify males and females (in that order)

pop

Relative populations of males and females (in that order)

Value

A list of class "sexRatioTest" with:

Variable Description
pM Observed proportion male
eM Expected proportion male
X2 Chi-squared test statistic
df Degrees of freedom for Chi-squared test
p p-value for Chi-squared test

Examples

# Use sexRatioTest() on household roster data from a survey in Tanzania
# (as.ex01) and census data of Tanzania extracted from Wolfram|Alpha knowledge
# engine (as.ex02)
svy <- as.ex01
ref <- as.ex02
censusM <- sum(ref$Males)
censusF <- sum(ref$Females)
sexRatioTest(svy$sex, codes = c(1, 2), pop = c(censusM, censusF))


ernestguevarra/nipnTK documentation built on April 13, 2024, 1:48 p.m.