Description Usage Arguments Details Value See Also Examples
Ratio estimation.
1 | ratest(num, den, adj = 1)
|
num |
A numeric vector, the numerator of the ratio. |
den |
A numeric vector, the denominator of the ratio. |
adj |
A numeric scalar, an adjustment factor to be multiplied by the ratio, default 1. |
All records with a missing value in either the numerator or the denominator are omitted from calculations.
A named vector with the sum of the numerators, the sum of the denominators, the ratio of the sums, the number of non-missing input pairs, and the standard deviation and 95
1 2 3 4 5 6 7 8 9 10 11 12 13 | # Size, weekly income, and food cost of 33 families from
# Cochran's (1977) Sampling Techniques.
familysize <- c(2, 3, 3, 5, 4, 7, 2, 4, 2, 5, 3, 6, 4, 4,
2, 5, 3, 4, 2, 4, 2, 5, 3, 4, 7, 3, 3, 6, 2, 2, 6, 4, 2)
income <- c(62, 62, 87, 65, 58, 92, 88, 79, 83, 62, 63, 62, 60, 75, 90,
75, 69, 83, 85, 73, 66, 58, 77, 69, 65, 77, 69, 95, 77, 69, 69, 67, 63)
foodcost <- c(14.3, 20.8, 22.7, 30.5, 41.2, 28.2, 24.2, 30, 24.2, 44.4,
13.4, 19.8, 29.4, 27.1, 22.2, 37.7, 22.6, 36, 20.6, 27.7, 25.9, 23.5,
39.8, 16.8, 37.8, 34.8, 28.7, 63, 19.5, 21.6, 18.2, 20.1, 20.7)
# weekly expenditure on food per person
ratest(foodcost, familysize)
# percentage of income spent on food
ratest(foodcost, income, 100)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.