enumerate {osDesign}R Documentation

Enumerate Function

Description

enumerate() generates a matrix of vectors that meet the margin totals MM and NN. enumerate.count() gives the total number of vectors that meet the margin totals MM and NN.

Usage

enumerate(MM, NN)
enumerate.count(MM, NN)

Arguments

MM

MM is a matrix of margin totals. Rows are groups, columns are margin totals

NN

NN is a matrix of outcome margin totals. Rows are groups, columns are margin totals. NN is always a K x 2 matrix, where K is the number of groups

Value

enumerate returns a matrix enumerate.count returns a numver

Author(s)

G. Malecha, E. Smoot

References

Smoot, E., and S. Haneuse. "On the Analysis of Hybrid Designs that Combine Group- and Individual-Level Data." Biometrics (in press, 2014).

Examples

data(infants0709, package = "osDesign")

#  Get marginal totals for low birth weight and smoking status by county
MM = table(infants0709$county, infants0709$smoker)
NN = table(infants0709$county, infants0709$lowbw)

#  Determine the number of possible solutions to margin totals for county 48
enumerate.count(MM[48,], NN[48,])

#  Generate matrix with all possible solutions to margin totals for county 48
enumerate(MM[48,], NN[48,])

[Package osDesign version 1.7 Index]