Skip to contents

Fit a zero-inflation estimator.

Usage

saeczi(
  samp_dat,
  pop_dat,
  lin_formula,
  log_formula = lin_formula,
  domain_level,
  B = 100L,
  mse_est = FALSE,
  estimand = "means",
  parallel = FALSE,
  transform_fun = NULL,
  inv_transform_fun = NULL
)

Arguments

samp_dat

A data.frame with domains, auxiliary variables, and the response variable of a sample

pop_dat

A data.frame with domains and auxiliary variables of a population.

lin_formula

Formula. Specification of the response and fixed effects of the linear regression model

log_formula

Formula. Specification of the response and fixed effects of the logistic regression model

domain_level

String. The column name in samp_dat and pop_dat that encodes the domain level

B

Integer. The number of bootstraps to be used in MSE estimation.

mse_est

Logical. Whether or not MSE estimation should happen.

estimand

String. Whether the estimates should be 'totals' or 'means'.

parallel

Logical. Should the MSE estimation be computed in parallel.

transform_fun

Function. Function to be applied to the response variable prior to modeling.

inv_transform_fun

Function. Inverse of transform_fun. Required if transform_fun is specified.

Value

An object of class `zi_mod` with defined `print()` and `summary()` methods. The object is structured like a list and contains the following elements:

* call: The original function call

* res: A data.frame containing the estimates and mse estimates

* lin_mod: The modeling object used to fit the original linear model

* log_mod: The modeling object used to fit the original logistic model

Examples

data(pop)
data(samp)

lin_formula <- DRYBIO_AG_TPA_live_ADJ ~ tcc16 + elev

result <- saeczi(samp_dat = samp,
                 pop_dat = pop,
                 lin_formula = lin_formula,
                 log_formula = lin_formula,
                 domain_level = "COUNTYFIPS",
                 mse_est = FALSE)
#> Warning: Model failed to converge with max|grad| = 0.00715735 (tol = 0.002, component 1)
#> Warning: Model is nearly unidentifiable: very large eigenvalue
#>  - Rescale variables?;Model is nearly unidentifiable: large eigenvalue ratio
#>  - Rescale variables?