[R] robust standard errors in maximum likelihood estimation; sandwich estimator for mle/mle2

Marc Jekel feuerwald at gmx.de
Wed Jul 2 18:19:42 CEST 2014


   Dear list,

   After more reading, I can specify my rather broad question I asked yesterday
   and therefore ask a better question: I have specified a function that gives
   me log likelihood values. In the function, I have several free parameters
   (the  function  itself  is not linear). I use mle2 to find the maximum
   likelihood estimators for all free parameters. When I use summary() on the
   object created by mle2 I get the maximum likelihhod estimators, standard
   errors, corresponding z-values and Pr(z).

   My problem: The data I fit the function to consists of repeated choices by
   multiple participants. This means I have to correct standard errors that are
   shown by summary() since these standard errors are calculated under the
   assumption that each choice is independent. From what I read is that I need
   the  sandwich  estimator (i.e., Huber) to estimate robust errors. This
   estimator is implemented in the R-library "sandwich". But, as far as I found
   out, the library needs an object of the (e.g.) type lm. An object resulting
   from mle2 cannot be used with the commands of the  package. In STATA maximum
   likelihood estimation with robust standard errors is easily implemented with
   he command "cluster(id)". Is there something similar in R?

   Thank you for any advice,

   Marc

   Gesendet: Dienstag, 01. Juli 2014 um 10:07 Uhr
   Von: "Marc Jekel" <feuerwald at gmx.de>
   An: r-help at r-project.org
   Betreff: maximum likelihood estimation with clustered data
   Dear list,

   I am currently trying to fit free parameters of a model from economics
   (cumulative prospect theory) using maximum likelihood estimation. I know how
   to do maximum likelihood estimation using mle or mle2 in R, the problem to
   which I could not find a solution to is that my data is correlated (i.e.,
   multiple participants with multiple responses) which needs to be accounted
   for when doing mle. In STATA, mle can be done with clustered data (with the
   command "ml model ..., cluster(id)") but I could not find an equivalent
   command in R.

   More  detail  (in  case someone tried to do the same before): I try to
   implement an approach proposed  by Glenn Harrison who shows in STATA how to
   implement user-written maximum likelihood estimates for utility functions
   with clustered
   data ([1]http://faculty.cbpp.uaa.alaska.edu/jalevy/protected/HarrisonSTATML.
   pdf).

   Thank you for any hint,

   Marc

References

   1. http://faculty.cbpp.uaa.alaska.edu/jalevy/protected/HarrisonSTATML.pdf


More information about the R-help mailing list