nmm_fit {NMMIPW} | R Documentation |
Fitting IPW or AIPW Estimators under Nonmonotone Missing at Random Data
Description
nmm_fit is the main function used to fit IPW or AIPW estimators under nonmonotone missing at random data
Usage
nmm_fit(
data,
O,
AIPW = FALSE,
formula = NULL,
func = NULL,
weights = NULL,
...
)
Arguments
data |
a data.frame to fit |
O |
missing indicator |
AIPW |
indicator if fitting augmented IPW |
formula |
optional formula specified to fit |
func |
optional fitting function, currently support 'lm' and 'glm' |
weights |
optional weights used in the estimation |
... |
further arguments passed to func, e.g. family = 'quasibinomial' for glm |
Value
NMMIPW returns an object of class "NMMIPW". An object of class "NMMIPW" is a list containing the following components:
coefficients |
the fitted values, only reported when formula and func are given |
coef_sd |
the standard deviations of coefficients, only reported when formula and func are given |
coef_IF |
the influnece function of coefficients, only reported when formula and func are given |
gamma_para |
the first step fitted valus |
AIPW |
an indicator of whether AIPW is fitted |
second_step |
an indicator of whether the second step is fitted |
second_fit |
if second step fitted, we report the fit object |
by_prod |
a list of by products that might be useful for users, including first step IF, jacobian matrices |
Examples
n = 100
X = rnorm(n, 0, 1)
Y = rnorm(n, 1 * X, 1)
O1 = rbinom(n, 1, 1/(1 + exp(- 1 - 0.5 * X)))
O2 = rbinom(n, 1, 1/(1 + exp(+ 0.5 + 1 * Y)))
O = cbind(O1, O2)
df <- data.frame(Y = Y, X = X)
fit <- nmm_fit(data = df, O = O, formula = Y ~ X, func = lm)