rsb | R Documentation |
Rao-Scott weights.
rsb(y = NULL, n = NULL, formula = NULL, data = NULL, id = NULL)
y |
vector of number positive. |
n |
vector of total number. |
formula |
Formula of the form cbind(y, n) ~ id, where y is the number positive, n is the total number, id is a factor for estimating the weights by subset. |
data |
data.frame containing variables of formula. |
id |
vector of factor for estimating the weights by subset. |
Estimates the cluster design effect {d}_{i}
as the
variance inflation due to clustering by the method of Rao and Scott. rsb
estimates the {d}_{i}
for use by rsbWt
or other functions.
A list with the following elements.
w
: vector of weights
d
: vector of {d}_{i}
estimates
PF-package
Rao JNK, Scott AJ, 1992. A simple method for the analysis of clustered binary data. Biometrics 48:577-585.
rsbWt.
# Weil's rat data (Table 1 of Rao and Scott)
rsb(rat$y, rat$n, id = rat$group)$d
# control treated
# 1.232495 3.952861
rsb(data = rat, formula = cbind(y, n) ~ group)$d
# control treated
# 1.232495 3.952861
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.