Skip to contents

as.SandwichLayer() uses the Design object passed to the design argument to populate the slots in a SandwichLayer object that a PreSandwichLayer does not have sufficient information for.

Usage

as.SandwichLayer(x, design, by = NULL, Q_data = NULL)

Arguments

x

a PreSandwichLayer object

design

a Design object

by

optional; a string or named vector of unique identifier columns in the data used to create design and the data used to fit the covariance adjustment model. Default is NULL, in which case unit of assignment columns are used for identification (even if they do not uniquely identify units of observation). If a named vector is provided, names should represent variables in the data used to create design, while values should represent variables in the covariance adjustment data.

Q_data

dataframe of direct adjustment sample, which is needed to generate the keys slot of the SandwichLayer object. Defaults to NULL, in which case if by is NULL, the data used to create design is used, and if by is not NULL, appropriate data further up the call stack (passed as arguments to cov_adj() or lmitt.formula(), for example) is used.

Value

a SandwichLayer object