Function for fitting Multivariate semi-continuous proportionally constrained two-part fixed effects model.

bc2(
  logistic,
  positive1,
  positive2,
  data,
  search.space = NULL,
  control.pars = NULL,
  parallel = F,
  core.nums = NULL,
  g.funs = NULL
)

Arguments

logistic

A one sided formula with only right hand side describing the predictors to be included in the logistic part of the model.

positive1

A formula describing the response and predictors to be used as the first positive part of the model.

positive2

A formula describing the response and predictors to be used as the second positive part of the model.

data

Data containing responses and predictors.

search.space

A named list containing usual parameters for controlling the optimization process of log-likelihood function.

All combinations of the given values in the list will be considered. Valid arguments inside the list are:

  • coeffs.start: Numeric vector containing values to be used as starting points of intercepts (a0, a1, a2), coefficients and constraints (b1 & b2) during optimization.

  • sigmas.start: Numeric vector containing values to be used as starting points of sigma1 & sigma2 during optimization.

  • ro.start: Numeric vector containing values to be used as starting points of ro during optimization.

  • ro.start: Optimization methods to be tested for optimizing the log-likelihood function.

  • iterations: Number of iterations to achieve the convergence in optimization process.

Default is NULL where a pre-defined search space will be used. See part 1 in Details.

control.pars

Additional control parameters used by optim function. Default is NULL. See Details section in ?optim.

parallel

Logical indicating whether optimization of different combinations in search.space must be done in parallel mode or not. Default is FALSE.

core.nums

Number of CPU cores to be used for parallel computation. Default is NULL where half of the CPU cores will be used. See ?detectCores.

g.funs

A single function or a list of length two containing the functions to be used for transforming non-zero responses.

If g.funs were specified by user, $Data part of return object will contain the un-transformed responses while structured data part will include transformed responses based on functions in g.funs.

Value

S3 print class of method 'bc2' which is A list of length 3 containing fitting information of the logistic and the two positive parts.

This list is a part of a more comprehensive return that can be accessed when the fit is saved in an object. The full return set contains:

  • $Data: Cleaned data-set with original and un-transformed responses. Also see g.funs argument.

  • $`Structured data`: A list of divided and cleaned data to be used in the fitting process. If g.funs were specified, transformed responses will be included in this part.

  • $`Optimization info`: A tibble containing information about evaluation of different combinations that was given in search.space for optimization.

  • $`Best combination`: The best combination of parameters that results in the best set of estimations.

  • $`Final tables`: The default print output of class bc2 that was mentioned earlier.

Details

When search.space is NULL, a pre-defined search space will be used which is:

list(coeffs.start=seq(-1,1,1),

     sigmas.start=c(.1,1),

     ro.start=c(-.5,.5),

     methods=c('Nelder-Mead','BFGS'),

     iterations=c(100,500))

References

https://journals.sagepub.com/doi/abs/10.1177/0962280218807730

See also

Author

Shahin Roshani