Description Usage Arguments Author(s) References See Also Examples
Methods for gmnl
objects which provide a plot of the distribution of the conditional expectation of the random parameters or the distribution of the conditional willigness-to-pay.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
x |
an object of class |
par |
a string giving the name of the variable with random parameter. |
effect |
a string indicating whether the conditional expectation, " |
wrt |
a string indicating with respect to which variable the WTP should be computed if |
type |
a string indicating the type of distribution: it can be a |
adjust |
bandwidth for the kernel density. |
main |
an overall title for the plot. |
col |
color for the graph. |
breaks |
number of breaks for the histrogram if |
ylab |
a title for the y axis. |
xlab |
a title for the x axis. |
ind |
a boolean. If |
id |
only relevant if |
... |
further arguments to be passed to |
Mauricio Sarrias
Greene, W. H. (2012). Econometric Analysis, Seventh Edition. Pearson Hall.
Train, K. (2009). Discrete Choice Methods with Simulation. Cambridge University Press.
gmnl
for the estimation of different multinomial models with individual heterogeneity and effect.gmnl
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | ## Not run:
## Examples using the Electricity data set from the mlogit package
library(mlogit)
data("Electricity", package = "mlogit")
Electr <- mlogit.data(Electricity, id.var = "id", choice = "choice",
varying = 3:26, shape = "wide", sep = "")
## Estimate a MIXL model with correlated random parameters
Elec.cor <- gmnl(choice ~ pf + cl + loc + wk + tod + seas| 0, data = Electr,
subset = 1:3000,
model = 'mixl',
R = 10,
panel = TRUE,
ranp = c(cl = "n", loc = "n", wk = "n", tod = "n", seas = "n"),
correlation = TRUE)
## Plot the density of the conditional expectation distribution of loc
plot(Elec.cor, par = "loc", effect = "ce", type = "density", col = "grey")
## Plot the conditional expectation of loc for each individual
plot(Elec.cor, par = "loc", effect = "ce", ind = TRUE, id = 1:30)
## Plot the WTP for cl
plot(Elec.cor, par = "loc", effect = "wtp", wrt = "pf")
## End(Not run)
|
Loading required package: maxLik
Loading required package: miscTools
Please cite the 'maxLik' package as:
Henningsen, Arne and Toomet, Ott (2011). maxLik: A package for maximum likelihood estimation in R. Computational Statistics 26(3), 443-458. DOI 10.1007/s00180-010-0217-1.
If you have questions, suggestions, or comments regarding the 'maxLik' package, please use a forum or 'tracker' at maxLik's R-Forge site:
https://r-forge.r-project.org/projects/maxlik/
Loading required package: Formula
Loading required package: zoo
Attaching package: 'zoo'
The following objects are masked from 'package:base':
as.Date, as.Date.numeric
Loading required package: lmtest
Estimating MIXL model
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.