
Convert a PreSandwichLayer to a SandwichLayer with a StudySpecification object
Source: R/SandwichLayer.R
as.SandwichLayer.Rdas.SandwichLayer() uses the StudySpecification
object passed to the specification argument to populate the slots
in a SandwichLayer object that a PreSandwichLayer does not
have sufficient information for.
Arguments
- x
a
PreSandwichLayerobject- specification
a
StudySpecificationobject- by
optional; a string or named vector of unique identifier columns in the data used to create
specificationand 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 createspecification, while values should represent variables in the covariance adjustment data.- Q_data
dataframe of direct adjustment sample, which is needed to generate the
keysslot of theSandwichLayerobject. Defaults to NULL, in which case ifbyis NULL, the data used to createspecificationis used, and ifbyis not NULL, appropriate data further up the call stack (passed as arguments tocov_adj()orlmitt.formula(), for example) is used.