drgeeData
extracts the model
variables and matrices from a data.frame
or an environment
object. It also performs some data cleaning and error checking.drgeeData(oformula, eformula, iaformula = formula(~1),
olink = c("identity", "log", "logit"),
elink = c("identity", "log", "logit"),
data = NULL, clusterid = NULL)
"identity"
, "log"
or
"logit"
. Default is "identity"
."identity"
, "log"
or
"logit"
. Default is "identity"
. When
olink="logit"
this is replaced by iaformula
,
oformula
and eformula
. Default is NULL
in which
case the variables will be expected to be found in the environment of the
data
argument.drgeeData
returns an object of class drgeeData
containingiaformula
.
This matrix will always contain a column with 1's.a
and
each column in x
.y
and each
column in x
.drgeeData
is called by drgee
and uses the
oformula
, eformula
and iaformula
arguments to
extract data from a data.frame
or environment
object. The data can then be used to for outcome/exposure nuisance model
based estimation or doubly robust estimation by calling obeFit
,
ebeFit
or drFit
respectively. drgeeData
uses
model.frame
and model.matrix
to remove incomplete
observations and to convert factors to dummy variables. Factor outcome
is only allowed when olink="logit"
and then only when the
factor has two levels. There are no restrictions on the exposure (RHS of
eformula
) or on factors appearing on the RHS of oformula
,
eformula
and iaformula
. The class method summary.drgeeData
produces strings for the
formulas with terms referring to the columns in the produced design
matrices.
drgee
, model.frame
and model.matrix
.