marginal.table: Create a Marginal Table

View source: R/BLfour.R

marginal.tableR Documentation

Create a Marginal Table

Description

The marginal.table function is used to summarize only the positive responses (joint positive responses for multiple MRCVs) for data arising from one, two, or three MRCVs. This function essentially provides a subset of counts from the item.response.table function.

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 items W1, ..., WI, Y1, ..., YJ, and Z1, ..., ZK (in this order).

I

The number of items corresponding to row variable W. I = 1 for the one MRCV case.

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 tables:tabular() function to produce a table containing positive counts.

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

# Create a marginal table for 1 MRCV
farmer.mtable.one <- marginal.table(data = farmer1, I = 1, J = 5) 
farmer.mtable.one

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

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

MRCV documentation built on Oct. 22, 2024, 5:06 p.m.