spORmissing: Semiparametric Targeted inference for the conditional odds...

View source: R/spORmissing.R

spORmissingR Documentation

Semiparametric Targeted inference for the conditional odds ratio with post-treatment informed outcome missingness.

Description

Semiparametric Targeted estimates and inference for the odds ratio in a partially-linear logistic-link semiparametric model with 'post-treatment“ informative outcome missingness. This version also allows for the outcome is missing-at-random conditional on Z,A,W where Z comes after A. The partially-linear logistic model assumes that 'logit(P(Y=1|A,W)) = b* A f(W) + h(W)' where 'h(W) = logit(P(Y=1|A=0,W))' is unspecified (nonparametric) and 'f(W)' is specified by a parametric model. Thus, only a correct parametric model is assumed for the conditional odds ratio, and all other nuisance functions are unspecified (nonparametric).

Usage

spORmissing(
  formula = logOR ~ 1,
  W,
  A,
  Y,
 
    Z = stop("No Z variable given. Use spOR or npOR instead if the variable `Z` is not used"),
  Delta,
  weights = NULL,
  W_new = W,
  glm_formula_A = NULL,
  sl3_learner_A = NULL,
  glm_formula_Delta = NULL,
  sl3_learner_Delta = NULL,
  glm_formula_YZ = NULL,
  sl3_learner_YZ = NULL,
  glm_formula_Y0W = NULL,
  smoothness_order_Y0W = 1,
  max_degree_Y0W = 2,
  num_knots_Y0W = c(20, 5),
  reduce_basis = 0.001,
  fit_control = list(),
  sl3_learner_default = Lrnr_hal9001_custom$new(max_degree = 2, smoothness_orders = 1,
    num_knots = c(30, 10)),
  parallel = F,
  ncores = NULL,
  ...
)

Arguments

formula

An R formula object describing the functional form of the conditional log odds ratio as a function of 'W'. This corresponds with 'f(W)' in the partially linear logistic-link model 'logit(P(Y=1|A,W)) = b*Af(W) + h(W)'.

W

A named matrix of baseline covariates

A

A binary vector with values in (0,1) encoding the treatment assignment

Y

A binary outcome variable with values in (0,1)

Z

A matrix of post-treatment variables that inform the missingness of the outcome 'Y'. This variable can be NULL if the missingness is only effected by 'A' and 'W'.

Delta

A binary vector that takes the value 1 if 'Y' is osberved/not-missing and 0 otherwise.

weights

An optional vector of weights for each observation. Use with caution. This can lead to invalid inferences if included naively.

W_new

An optional matrix of new values of the baseline covariates 'W' at which to predict odds ratio.

glm_formula_A

(Not recommended). An optional R formula object describing the functional form of P(A=1|W). If provided, glm is used for the fitting. (Not recommended. This method allows for and works best with flexible machine-learning algorithms.)

sl3_learner_A

An optional tlverse/sl3 learner object used to estimate P(A=1|W). If both sl3_learner_A and glm_formula_A are not provided, a default learner is used (Lrnr_hal9001).

glm_formula_Delta

(Not recommended). An optional R formula object describing the functional form of P(Delta=1|A,Z,W) to fit with glm. If provided, it is estimated using glm. (Not recommended. This method allows for and works best with flexible machine-learning algorithms.)

sl3_learner_Delta

An optional tlverse/sl3 learner object used to estimate P(Delta=1|A,Z,W).

glm_formula_YZ

A(Not recommended). An optional R formula object describing the functional form of the full conditional outcome mean P(Y=1|Z,A,W). If provided, it is estimated using glm. (Not recommended. This method allows for and works best with flexible machine-learning algorithms.)

sl3_learner_YZ

An optional tlverse/sl3 learner object used to estimate the full conditional outcome mean P(Y=1|Z,A,W).

glm_formula_Y0W

(Not recommended). An optional R formula object describing the nuisance function 'h(W) := logit(P(Y=1|A=0,W))'in the partially linear logistic-link model 'logit(P(Y=1|A,W)) = b*Af(W) + h(W)'

smoothness_order_Y0W

Smoothness order of the nuisance function 'h(W) := logit(P(Y=1|A=0,W))'in the partially linear logistic-link model 'logit(P(Y=1|A,W)) = b*Af(W) + h(W)' to be estimated nonparametrically using the Highly Adaptive Lasso (hal9001), a powerful spline regression algorithm. 0 = discontinuous piece-wise constant function, 1 = continuous piece-wise linear, 2 = smooth piece-wise quadratic

max_degree_Y0W

Max degree of interaction (of spline basis functions) of the nuisance function 'h(W) := logit(P(Y=1|A=0,W))'in the partially linear logistic-link model 'logit(P(Y=1|A,W)) = b*Af(W) + h(W)' to be estimated nonparametrically using the Highly Adaptive Lasso (hal9001). 'max_degree=1' corresponds with an additive model, 'max_degree=2' corresponds with a bi-additive (two-way) model. This parameter significantly affects computation time.

num_knots_Y0W

A vector specifying the number of knots to use when generating 'HAL' spline basis functions of each interaction degree. For computational benefits, the number of knots should decrease exponentially with degree.

reduce_basis

See analagous argument in package hal9001.

fit_control

See analagous argument in package hal9001.

sl3_learner_default

A default sl3 Learner to be used if neither a glm formula or sl3 learner is provided for one of the nuisance functions. By default, Lrnr_hal9001 is used.

...

Other arguments to be passed to hal9001::fit_hal for fitting.

Details

NOTE: For more robust nonparametrically correct inference with no parametric assumptions, use the function instead. In the function, the user-specified parametric model is instead treated as an approximation rather than the truth.


Larsvanderlaan/npOddsRatio documentation built on May 3, 2022, 12:05 p.m.