Learn R Programming

rmdcev (version 1.3.3)

CreateBlankPolicies: CreateBlankPolicies

Description

Create 'zero effect' policies that can then be modified by the user

Usage

CreateBlankPolicies(npols, model, price_change_only = TRUE)

Value

A named list with four elements:

price_p

A list of npols numeric vectors, each of length \(J+1\) (number of non-numeraire alternatives plus the numeraire), initialised to zero. Modify these vectors to specify proportional price changes for each policy.

dat_psi_p

If price_change_only = FALSE and the model has psi variables, a list of npols matrices copied from the estimated model's psi covariate data (one row per individual-alternative combination). NULL otherwise.

dat_phi_p

If price_change_only = FALSE and the model is a kt_ee specification with phi variables, a list of npols matrices copied from the estimated model's phi covariate data. NULL otherwise.

price_change_only

Logical; the value of the price_change_only argument, retained for use by mdcev.sim().

Arguments

npols

Number of policies to simulate

model

Estimated model from mdcev

price_change_only

Logical value for whether to include policy changes to dat_psi. Defaults to TRUE. TRUE implies that only price changes are used in simulation.

Examples

Run this code
# \donttest{
data_rec <- mdcev.data(data_rec, subset = id <= 500, id.var = "id",
                alt.var = "alt", choice = "quant")

mdcev_est <- mdcev( ~ 0, data = data_rec,
               model = "hybrid0", algorithm = "MLE",
               std_errors = "mvn", backend = "rstan")
CreateBlankPolicies(npols = 2, mdcev_est)
# }

Run the code above in your browser using DataLab