ls_vcv: Variance-Covariance Matrix

Description Usage Arguments Details Value Examples

View source: R/ls_functions.R

Description

Variance-Covariance Matrix

Usage

1
ls_vcv(par, data, method)

Arguments

par

vector c(piA, piB, muA1, muA0, muB1, sigma).

data

data frame containing cols y (positive outcome with zeros) and z (treatment).

method

method used for computation: score, hessian, robust, and bootstrap.

Details

Computes the variance-covariance matrix:
if method = "hessian" then the standard errors are computed by the numeric hessian
if method = "score" then standard errors are computed from the gradient
if method = "robust" then white robust standard errors are computed
if method = "bootstrap" then the standard errors are computed by bootstrap
For the input data frame, column z is the dummy variable for treatment. If z = 1, then the observation has received treatment. If z = 0, then the observation has not received treatment.

Value

the variance-covariance matrix based on the specificed method.

Examples

1
2
sim = sim_latent_strat(n=10000, piA=0.2, piB=0.1, muA1=5, muA0=4.5, muB1=3, sigma=0.3)
ls_vcv(sim$par, sim$data, "hessian")

zthuang0422/PURM-2021-Latent-Stratification documentation built on Dec. 23, 2021, 10:12 p.m.