plot.Rchoice: Plot of the distribution of conditional expectation of random... In Rchoice: Discrete Choice (Binary, Poisson and Ordered) Models with Random Parameters

Description

Plot the distribution of the conditional expectation of the random parameters or compensating variations for objects of class `Rchoice`.

Usage

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17``` ```## 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, ... ) ```

Arguments

 `x` a object of class `Rchoice`, `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 "`ce`", or the conditional expectation of the individual compensating variations "`cv`", `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 `histogram` or a `density` of the conditional expectation, `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 `type = "histogram"`, `ylab` a title for the y axis, `xlab` a title for the x axis, `ind` a boolean. If `TRUE`, a 95 As default, the conditional expectation of `par` for the first 10 individual is plotted, `id` only relevant if `ind` is not `NULL`. This is a vector indicating the individuals for which the confidence intervals are plotted, `...` further arguments. Ignored.

Mauricio Sarrias

References

• 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.
 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23``` ```## Not run: ## Probit Model with Random Effects and Random Parameters data('Unions', package = 'pglm') Unions\$lwage <- log(Unions\$wage) union.ran <- Rchoice(union ~ age + exper + rural + lwage, data = Unions[1:2000, ], family = binomial('probit'), ranp = c(constant = "n", lwage = "t"), R = 10, panel = TRUE, index = "id", print.init = TRUE) ## Plot the distribution of the conditional mean for lwage plot(union.ran, par = "lwage", type = "density") ## Plot the conditional mean for the first 20 individuals plot(union.ran, par = "lwage", ind = TRUE, id = 1:20, col = "blue") ## Plot the compensating variation plot(union.ran, par = "lwage", effect = "cv", wrt = "rural", type = "histogram") ## End(Not run) ```