rsb: Rao-Scott weights.

View source: R/rsbWt.r

rsbR Documentation

Rao-Scott weights.

Description

Rao-Scott weights.

Usage

rsb(y = NULL, n = NULL, formula = NULL, data = NULL, id = NULL)

Arguments

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.

Details

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.

Value

A list with the following elements.

w

vector of weights

d

vector of {d}_{i} estimates

Author(s)

PF-package

References

Rao JNK, Scott AJ, 1992. A simple method for the analysis of clustered binary data. Biometrics 48:577-585.

See Also

rsbWt.

Examples

# 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

ABS-dev/PF documentation built on April 26, 2024, 3:29 p.m.