help mixlogitwtp

Title

mixlogitwtp -- Mixed logit model in WTP space

Syntax

mixlogitwtp
depvar
[indepvars] [if] [in] ,
group(varname)
price(varname)
[rand(varlist)
id(varname)
ln(#)
corr
nrep(#)
burn(#)
level(#)
constraints(numlist)
vce(vcetype)
maximize_options]

mixlpred
newvar [if] [in]
[, nrep(#) burn(#)]

mixlcov
[,
sd]

mixlbeta
varlist [if] [in]
, saving(filename) [replace nrep(#) burn(#)]

Description

mixlogitwtp fits mixed logit models in willingness to pay (WTP) space by using maximum simulated
likelihood (Train and Weeks, 2005; Scarpa et al., 2008; Hole and Kolstad, 2012). The command is based on
mixlogit (Hole, 2007).

All of the mixlogit postestimation commands are available after mixlogitwtp:

mixlpred calculates predicted probabilities. The predictions are available
both in and out of sample; type mixlpred ... if e(sample) ... if
predictions are wanted for the estimation sample only.

mixlcov calculates the elements in the coefficient covariance matrix along
with their standard errors. This command is relevant only when the coefficients
are specified to be correlated; see the corr option below. mixlcov is
a wrapper for nlcom (see [R] nlcom).

mixlbeta calculates individual-level parameters corresponding to the variables in
the specified varlist using the method proposed by Revelt and Train (2000)
(see also Train, 2009, ch. 11). The individual-level parameters are stored in a data file
specified by the user. As with mixlpred the predictions are available both in and
out of sample; type mixlbeta ... if e(sample) ... if predictions are wanted
for the estimation sample only.

Options for mixlogitwtp

group(varname) is required and specifies a numeric identifier variable
for the choice occasions.

price(varname) is required and specifies the price variable, or more generally
the variable whose coefficient is the denominator in the WTP expression. The coefficient
on the price variable is assumed to be lognormally distributed. Since this implies that
the price coefficient is positive, the price variable must be multiplied by -1 before entering
the model (see the examples below). Train and Weeks (2005) show that the price coefficient
in WTP space models incorporates any differences in scale across respondents.

rand(varlist) specifies the independent variables whose WTP coefficients
are random. The random coefficients can be specified to be normally or lognormally
distributed (see the ln() option). The variables immediately following the
dependent variable in the syntax are specified to have fixed WTP coefficients
(see the examples below).

id(varname) specifies a numeric identifier variable for the decision
makers. This option should be specified only when each individual performs
several choices; i.e., the dataset is a panel.

ln(#) specifies that the last # variables in rand() have
lognormally rather than normally distributed WTP coefficients. The default is
ln(0).

corr specifies that the random coefficients are correlated. The default
is that they are independent. The mixlcov command can be used postestimation
to obtain the elements in the variance-covariance matrix of the correlated coefficients
along with their standard errors.

nrep(#) specifies the number of draws used for the simulation. The default is nrep(50).
It is recommended to run the command several times with an increasing number of draws in each run
until the estimates stabilise. See Gu et al. (2013) for a discussion of computational issues in the
context of the gmnl command, most of which are also relevant for mixlogitwtp.

burn(#) specifies the number of initial sequence elements to drop when
creating the Halton sequences. The default is burn(15).

level(#); see estimation options.

constraints(numlist); see estimation options.

vce(vcetype); vcetype may be oim,
robust, cluster clustvar, or opg.

maximize_options:
difficult,
technique(algorithm_spec),
iterate(#), trace, gradient,
showstep, hessian, tolerance(#),
ltolerance(#) gtolerance(#), nrtolerance(#),
from(init_specs); see maximize.

Options for mixlpred

nrep(#) specifies the number of draws used for the simulation.
The default is nrep(50).

burn(#) specifies the number of initial sequence elements to drop when
creating the Halton sequences. The default is burn(15).

Option for mixlcov

sd reports the standard deviations of the correlated coefficients instead
of the covariance matrix.

Options for gmnlbeta

saving(filename) save individual-level parameters to filename.

replace overwrite filename.

nrep(#) specifies the number of draws used for the simulation.
The default is nrep(50).

burn(#) specifies the number of initial sequence elements to drop when
creating the Halton sequences. The default is burn(15).

Examples

The following examples use traindata.dta, which is described in Hole (2007).

Example 1: Fixed WTP coefficients for contract, local and wknown, normally
distributed WTP coeficients for tod and seasonal.

. use http://fmwww.bc.edu/repec/bocode/t/traindata.dta

. gen mprice = -price

. mixlogitwtp y contract local wknown, group(gid) id(pid) price(mprice) rand(tod seasonal) nrep(500)

Among other things the results show that the estimated WTP for a well-known company is 1.73 (cents per kilowatt-hour) and
the mean WTP to avoid seasonal rates is 9.97 with an SD of 2.45.

As described above the price coefficient is assumed to have a log-normally distributed coefficient. The reported
estimates are the mean and SD for the log of the price coefficient. The mean and SD of the price coefficient
itself can be calculated using nlcom - see e.g. Hole (2007, p. 395) for the relevant formulas:

. nlcom (Mean_price: -exp([Mean]mprice + 0.5*[SD]mprice^2))

. nlcom (SD_price: exp([Mean]mprice + 0.5*[SD]mprice^2) * sqrt(exp([SD]mprice^2)-1))

Note that the mean has been multiplied by -1 to undo the sign change introduced in the estimation process.

Example 2: Normally distributed WTP coefficients for contract, local and wknown, lognormally
distributed WTP coeficients for tod and seasonal.

Specifying a coefficient to be lognormally distributed implies that WTP is positive for all individuals, but negative
WTPs can be accommodated by entering the attribute multiplied by -1 in the model:

. gen mtod = -tod

. gen mseasonal = -seasonal

. mixlogitwtp y, group(gid) id(pid) price(mprice) rand(contract local wknown mtod mseasonal) ln(2) nrep(500)

The reported mean and SD estimates for tod and seasonal are the mean and SD for the log of the WTP coefficients.
The mean and SD of the WTP coefficients themselves can be calculated using nlcom, e.g.:

. nlcom (Mean_WTP_tod: -exp([Mean]mtod + 0.5*[SD]mtod^2))

. nlcom (SD_WTP_tod: exp([Mean]mtod + 0.5*[SD]mtod^2) * sqrt(exp([SD]mtod^2)-1))

Note that the mean has been multiplied by -1 to undo the sign change introduced in the estimation process.

Example 3: As example 1 but allowing the WTP coefficients for tod and seasonal to be correlated with
each other and with the price coefficient.

. mixlogitwtp y contract local wknown, group(gid) id(pid) price(mprice) rand(tod seasonal) nrep(500) corr

The final 6 coefficients are the estimated elements of the lower-triangular matrix L, where the covariance matrix for
the random coefficients is given by V = LL'. The elements in the V matrix along with their standard errors can be obtained
using mixlcov.

Note

Mixed logit models in WTP space can also be estimated using the gmnl command (Gu et al., 2013), but mixlogitwtp
is more convenient for this purpose. The two commands will not in general give identical results (although they should be
similar) since gmnl uses pseudo-random draws instead of Halton draws for the scale coefficient (which can be interpreted as
the price coefficient in WTP space models). In contrast mixlogitwtp uses Halton draws for all of the random coefficients.
As the number of draws increases any differences should become smaller.

References

Gu Y, Hole AR, Knox S. 2013. Fitting the generalized multinomial logit model in Stata.
The Stata Journal 13: 382-397.

Hole AR. 2007. Fitting mixed logit models by using maximum simulated likelihood.
The Stata Journal 7: 388-401.

Hole AR, Kolstad JR. 2012. Mixed logit estimation of willingness to pay distributions:
a comparison of models in preference and WTP space using data from a health-related choice
experiment. Empirical Economics 42: 445-469.

Revelt D, Train K. 2000. Customer-specific taste parameters and mixed logit:
Households' choice of electricity supplier. Working Paper, Department of Economics,
University of California, Berkeley.

Scarpa R, Thiene M, Train K. 2008. Utility in willingness to pay space: A tool
to address confounding random scale effects in destination choice to the Alps.
American Journal of Agricultural Economics 90: 994-1010.

Train KE, Weeks M. 2005. Discrete choice models in preference space and willingness-to-pay
space. In: Scarpa R, Alberini A (eds) Application of simulation methods in environmental and resource
economics. Springer, Dordrecht, pp 1-16.

Train KE. 2009. Discrete Choice Methods with Simulation.
Cambridge: Cambridge University Press.

Author

Arne Risa Hole (a.r.hole@sheffield.ac.uk), Department of Economics, University of Sheffield.

Acknowledgements

Thanks to Kenneth Train for suggesting writing this command.

Also see

Manual: [R] asclogit [R] clogit

Online: [R] asclogit [R] clogit