effect.Rchoice: Get the conditional individual coefficients

View source: R/Rchoice.methods.R

effect.RchoiceR Documentation

Get the conditional individual coefficients

Description

This a helper function to obtain the individuals' conditional estimate of the random parameters or compensating variations.

Usage

## S3 method for class 'Rchoice'
effect(object, par = NULL, effect = c("cv", "ce"), wrt = NULL, ...)

Arguments

object

an object of class Rchoice,

par

a string giving the name of the variable with random parameter,

effect

a string indicating what should be computed: the conditional expectation of the individual coefficients "ce", or the conditional expectation of the individual compensating variations "cv",

wrt

a string indicating respect to which variable the compensating variation should be computed,

...

further arguments. Ignored.

Value

A named list where “mean” contains the individuals' conditional mean for the random parameter or compensating variation, and where ‘sd.est’ contains their standard errors.

References

  • Greene, W. H. (2012). Econometric Analysis, Seventh Edition. Pearson Hall.

  • Train, K. (2009). Discrete Choice Methods with Simulation. Cambridge university press.

See Also

Rchoice for the estimation of different discrete choice models with individual parameters.

Examples


# 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)

## Get the individuals' conditional mean and their standard errors for ment                      
bi.ment <- effect(poisson.ran, par = "ment", effect = "ce")
summary(bi.ment$mean)
summary(bi.ment$sd.est)


Rchoice documentation built on March 31, 2023, 11:13 p.m.