View source: R/Rchoice.methods.R
plot.Rchoice | R Documentation |
Plot the distribution of the conditional expectation of the random parameters or compensating variations for objects of class Rchoice
.
## S3 method for class 'Rchoice'
plot(
x,
par = NULL,
effect = c("ce", "cv"),
wrt = NULL,
type = c("density", "histogram"),
adjust = 1,
main = NULL,
col = "indianred1",
breaks = 10,
ylab = NULL,
xlab = NULL,
ind = FALSE,
id = NULL,
...
)
x |
a object of class |
par |
a string giving the name of the variable with random parameter, |
effect |
a string indicating what should be plotted: the conditional expectation of the individual coefficients " |
wrt |
a string indicating repect to which variable should be computed the compensating variation, |
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. Ignored. |
Mauricio Sarrias
Greene, W. H. (2012). Econometric analysis, Seventh Edition. Pearson Hall.
Train, K. (2009). Discrete choice methods with simulation. Cambridge university press.
Rchoice
for the estimation of different discrete choice models with individual parameters.
# Poisson with random parameters
data("Articles")
poisson.ran <- Rchoice(art ~ fem + mar + kid5 + phd + ment,
data = Articles, family = poisson,
ranp = c(kid5 = "n", phd = "n", ment = "n"),
R = 10)
## Plot the distribution of the conditional mean for ment
plot(poisson.ran, par = "ment", type = "density")
## Plot the conditional mean for the first 20 individuals
plot(poisson.ran, par = "ment", ind = TRUE, id = 1:20, col = "blue")
## Plot the compensating variation with respect to fem
plot(poisson.ran, par = "ment", effect = "cv", wrt = "fem", type = "histogram")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.