This function estimates a nested probit model based on a given
RprobitB_fit object.
Usage
# S3 method for class 'RprobitB_fit'
update(
object,
form,
re,
alternatives,
id,
idc,
standardize,
impute,
scale,
R,
B,
Q,
print_progress,
prior,
latent_classes,
...
)Arguments
- object
An object of class
RprobitB_fit.- form
[
formula]
A model description with the structurechoice ~ A | B | C, wherechoiceis the name of the dependent variable (the choices),Aare names of alternative and choice situation specific covariates with a coefficient that is constant across alternatives,Bare names of choice situation specific covariates with alternative specific coefficients,and
Care names of alternative and choice situation specific covariates with alternative specific coefficients.
Multiple covariates (of one type) are separated by a
+sign. By default, alternative specific constants (ASCs) are added to the model. They can be removed by adding+0in the second spot.In the ordered probit model (
ordered = TRUE), theformulaobject has the simple structurechoice ~ A. ASCs are not estimated.- re
[
character()|NULL]
Names of covariates with random effects. Ifre = NULL(the default), there are no random effects. To have random effects for the ASCs, include"ASC"inre.- alternatives
[
character()]
The names of the choice alternatives. If not specified, the choice set is defined by the observed choices.If
ordered = TRUE,alternativesis assumed to be specified with the alternatives ordered from worst to best.- id
[
character(1)]
The name of the column inchoice_datathat contains unique identifier for each decision maker.- idc
[
character(1)]
The name of the column inchoice_datathat contains unique identifier for each choice situation of each decision maker. By default, these identifier are generated by the order of appearance.- standardize
[
character()|"all"]
Names of covariates that get standardized.Covariates of type 1 or 3 have to be addressed by
<covariate>_<alternative>.If
standardize = "all", all covariates get standardized.- impute
A character that specifies how to handle missing covariate entries in
choice_data, one of:"complete_cases", removes all rows containing missing covariate entries (the default),"zero", replaces missing covariate entries by zero (only for numeric columns),"mean", imputes missing covariate entries by the mean (only for numeric columns).
- scale
[
character(1)]
A character which determines the utility scale. It is of the form<parameter> := <value>, where<parameter>is either the name of a fixed effect orSigma_<j>,<j>for the<j>th diagonal element ofSigma, and<value>is the value of the fixed parameter.- R
[
integer(1)]
The number of iterations of the Gibbs sampler.- B
[
integer(1)]
The length of the burn-in period.- Q
[
integer(1)]
The thinning factor for the Gibbs samples.- print_progress
[
logical(1)]
Print the Gibbs sampler progress?- prior
[
list]
A named list of parameters for the prior distributions. See the documentation ofcheck_priorfor details about which parameters can be specified.- latent_classes
[
list()|NULL]
Optionally parameters specifying the number of latent classes and their updating scheme. The values in brackets are the default.C(1): The fixed number (greater or equal 1) of (initial) classes.wb_update(FALSE): Set toTRUEfor weight-based class updates.dp_update(FALSE): Set toTRUEfor Dirichlet process class updates.Cmax(10): The maximum number of latent classes.
The following specifications are used for the weight-based updating scheme:
buffer(50): The number of iterations to wait before the next update.epsmin(0.01): The threshold weight for removing a latent class.epsmax(0.7): The threshold weight for splitting a latent class.deltamin(0.1): The minimum mean distance before merging two classes.deltashift(0.5): The scale for shifting the class means after a split.
- ...
Currently not used.
