mrp_merge: Merge cell weight predictions from a MRP model with survey...

Description Usage Arguments Details Value See Also

Description

Extracts the weighted and unweighted cell predictions from the output of mrp_model and merges it with a data frame. The data frame passed to data should be the same object used in the call to mrp_model. For mrp_grp, adds the 'grp' column to the survey data for merging.

Usage

1
2
3
mrp_merge(data, mrp.fit, by = "grp", ...)

mrp_grp(data, model)

Arguments

data

A data frame containing the original survey data to merge with the predicted cell weights.

mrp.fit

An object of class mrp.model produced by mrp_model to extract cell predictions from.

by

character: The column name to merge by. Defaults to 'grp', which is the default variable for indexing cell interactions produced by mrp_table.

...

Other agruments passed on to merge.

Details

The resulting data frame will have value labels copied from the original data object using copy_lev.

Value

For mrp_merge, a data frame with merged MRP cell predictions.

For mrp_grp, a character vector containing the various combinations of values from the variables used in the underlying formula passed to model in mrp_table.

See Also

mrp_table, mrp_model


alexdulin/MCmrp documentation built on May 11, 2019, 11:29 p.m.