Learn R Programming

MRCV (version 0.1-0)

marginal.table: Create a Marginal Table

Description

The marginal.table function is used to summarize data arising from two or three MRCVs. For the two MRCV case, a cross-tabulation of the positive responses for each (Wi, Yj) pair is presented as a table. For the three MRCV case, a cross-tabulation of the positive responses for each (Wi, Yj) pair is presented conditional on the positive responses for each Zk.

Usage

marginal.table(data, I, J, K = NULL)

Arguments

data
A data frame containing the raw data where rows correspond to the individual item response vectors, and columns correspond to the binary items W1, ..., WI, Y1, ..., YJ, and Z1, ..., ZK (in this order). The third set of items is only necessary when analyz
I
The number of items corresponding to row variable W.
J
The number of items corresponding to column variable Y.
K
The number of items corresponding to strata variable Z.

Value

  • The marginal.table function uses the tabular function (package tables) to produce a table containing the IxJ positive counts (or K tables containing the IxJ positive counts in the case of three MRCVs).

See Also

The item.response.table function for creating an item response table or data frame that summarizes both the positive and negative responses for each (Wi, Yj) pair (conditional on the response for each Zk in the case of three MRCVs).

Examples

Run this code
# Create a marginal table for 2 MRCVs
farmer.mtable <- marginal.table(data = farmer2, I = 3, J = 4) 
farmer.mtable

# Create a marginal table for 3 MRCVs
farmer.mtable.three <- marginal.table(data = farmer3, I = 3, J = 4, K = 5) 
farmer.mtable.three

Run the code above in your browser using DataLab