Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: st: Problem with bsample and simulate when estimating a mixed logit model


From   Poirier Julie <Julie.Poirier@ensae.fr>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   RE: st: Problem with bsample and simulate when estimating a mixed logit model
Date   Thu, 25 Nov 2010 13:04:43 +0100

Thanks so much for your help, Arne!
I'll try with that.

Julie

-----Message d'origine-----
De : owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] De la part de Arne Risa Hole
Envoyé : jeudi 25 novembre 2010 12:41
À : statalist@hsphsun2.harvard.edu
Objet : Re: st: Problem with bsample and simulate when estimating a mixed logit model

Hi Julie,

Why not just use -bootstrap-, e.g.:

use traindata.dta
bootstrap wtp=(-_b[seasonal]/_b[price]), ///
cluster(pid) idcluster(newpid) group(gid) reps(10): ///
mixlogit y price contract local wknown tod, ///
group(gid) id(newpid) rand(seasonal)

traindata.dta is described in
http://www.stata-journal.com/article.html?article=st0133.

Alternatively you can use the -wtp- module (available from SSC) to
obtain parametric (as opposed to non-parametric) bootstrap CIs. This
is a more practical approach given the time it normally takes to
estimate a mixed logit model.

I hope this helps.

Arne

On 18 November 2010 14:43, Poirier Julie <Julie.Poirier@ensae.fr> wrote:
> Hi,
>
> I have some problems running bootstrap with STATA's -bsample- command.
>
> I am using the following version of stata:
>
> Stata/MP 10.1 for Windows
> Born 18 Aug 2009
>
> I have some choice experiments data and I want to estimate willingness-to-pay through the estimation of a mixed logit model.
> I am currently using the -mixlogit- module (mixlogit 1.2.2 18Oct2010, written by Arne Risa Hole) to estimate my choice model and it works pretty well. I obtained parameters estimates and I computed my willingness-to-pay from these parameters estimates using the  -nlcom- command. Because I want to improve my work and obtain the distribution of my willingness to pay with the bootstrap method.
>
> Because the statistic I want to bootstrap does not work with the bootstrap command, I need to write my own bootstrap program. To do so, I am using the -bsample- command together with the -simulate- command. I want to draw 99 bootstrap replications from my sample, and the sampling is stratified by the groupe variable. The willingness to pay are given by wtplitto, wtptouq, wtpdives, wtpvie.
>
> My stata program is the following:
>
> program define myboot, rclass
>  1. preserve
>  2. bsample, strata(group)
>  3. mixlogit  choix statusquo contribution, group( group) rand( litto touq dives vie)
>  4. return scalar wtplitto=-_b[litto]/_b[contribution]
>  5. return scalar wtptouq=-_b[touq]/_b[contribution]
>  6. return scalar wtpdives=-_b[dives]/_b[contribution]
>  7. return scalar wtpvie=-_b[vie]/_b[contribution]
>  8. return scalar wtpv=r(wtpvie)
>  9. return scalar wtpd=r(wtpdives)
>  10. return scalar wtpt=r(wtptouq)
>  11. return scalar wtpl=r(wtplitto)
>  12. restore
>  13. end
>
> . matrix wtp=( r(wtpvie), r(wtpdives), r(wtptouq), r(wtplitto))
>
> . simulate wtpv=r(wtpvie) wtpd=r(wtpdives) wtpt=r(wtptouq) wtpl=r(wtplitto), reps(99) seed(12) : myboot
>
> When running the command, stata doesn't manage to do the boostrap replications and it seems that it makes an infinite number of iterations. Indeed, when I add the option -iterate()- in the mixlogit syntax in order to specify the maximum number of iterations for each bootstrap replications, then Stata gives me some results for the -simulate- command, but the boostrap results I obtain using the -bstat- command (for example the bootstrap standard errors associated with my willingness to pay estimates)  are quite the same as those I obtained using the -nlcom- command. So the bootstrap doesn't help me in that case!
>
> Do you know what I am doing wrong?
>
> Thanks.
>
> Julie Poirier
>
>
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index