Function to specify the propensity score (PS) model for the inverse probability weighting estimator.
This function provides basic functions logistic regression with a given link function (currently
we support logit
, probit
and cloglog
) with additional information about the analytic variance estimator
of the mean.
Usage
method_ps(link = c("logit", "probit", "cloglog"), ...)
Value
A list
of functions and elements for a specific link function with the following entries:
- make_log_like
log-likelihood function for a specific link function
- make_gradient
gradient of the loglik
- make_hessian
hessian of the loglik
- make_link
link function
- make_link_inv
inverse link function
- make_link_der
first derivative of the link function
- make_link_inv_der
first derivative of the the inverse link function
- make_link_inv_rev
defines 1/inv_link
- make_link_inv_rev_der
first derivative of 1/inv_link
- variance_covariance1
for the IPW estimator: variance component for the non-probability sample
- variance_covariance2
for the IPW estimator: variance component for the probability sample
- b_vec_ipw
for the IPW estimator: the \(b\) function as defined in the Chen et al. (2020, sec. 3.2, eq. (9)-(10); sec 4.1)
- b_vec_dr
for the DR estimator: the \(b\) function as defined in the Chen et al. (2020, sec. 3.3., eq. (14); sec 4.1)
- t_vec
for the DR estimator: the \(b\) function as defined in the Chen et al. (2020, sec. 3.3., eq. (14); sec 4.1)
- var_nonprob
for the DR estimator: non-probability component of the variance for DR estimator
- link
name of the selected link function for the PS model (character)
- model
model type (character)
Examples
# Printing information on the model selected
method_ps()
#> Propensity score model with logit link
# extracting specific field
method_ps("cloglog")$make_gradient
#> function (X_nons, X_rand, weights, weights_rand, ...)
#> {
#> function(theta) {
#> eta1 <- as.matrix(X_nons) %*% theta
#> eta2 <- as.matrix(X_rand) %*% theta
#> invLink1 <- inv_link(eta1)
#> invLink2 <- inv_link(eta2)
#> t(t(X_nons) %*% (weights * exp(eta1)/invLink1) - t(X_rand) %*%
#> (weights_rand * exp(eta2)))
#> }
#> }
#> <bytecode: 0x564d7d2738d8>
#> <environment: 0x564d7bbdf5b0>