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]

Fwd: st: bootstrapping question


From   Shuaizhang Feng <[email protected]>
To   [email protected]
Subject   Fwd: st: bootstrapping question
Date   Thu, 12 Sep 2013 11:32:53 +0800

---------- Forwarded message ----------
From: Shuaizhang Feng <[email protected]>
Date: Thu, Sep 12, 2013 at 9:25 AM
Subject: Re: st: bootstrapping question
To: [email protected]


Dear Maarten: Thanks for the reply and the example. I went through the
example you gave but in the end the command

mlogit marst, base(0) rrr vce(bootstrap, reps(100))

did not seem to produce the desired result.   here is the results given:

. mlogit marst, base(0) rrr vce(bootstrap, reps(100))
(running mlogit on estimation sample)

Bootstrap replications (100)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5
..................................................    50
..................................................   100

Multinomial logistic regression                 Number of obs      =      2246
                                                Replications       =       100
                                                Wald chi2(0)       =         .
                                                Prob > chi2        =         .
Log likelihood = -1949.8134                     Pseudo R2          =    0.0000

------------------------------------------------------------------------------
             |   Observed   Bootstrap                         Normal-based
       marst |        RRR   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
never_marr~d |  (base outcome)
-------------+----------------------------------------------------------------
divorced_o~d |
-------------+----------------------------------------------------------------
married      |
------------------------------------------------------------------------------


I am also interested getting the standard errors of
mean(x1)/mean(x1+x2) as well as mean(x1+x2).  {in your example, it
would be mean(never_married)/mean(never_married+married) and
mean(never_married+married)}       can those also be directly read
from mlogit.  Is there a direct way just to use bootstrap to calculate
those without using mlogit?

thanks again for your help!

Sz






On Wed, Sep 11, 2013 at 10:32 PM, Maarten Buis <[email protected]> wrote:
> On Wed, Sep 11, 2013 at 4:14 PM, Shuaizhang Feng wrote:
>> I have a question on using bootstrap to generate standard errors.
>> Suppose I have a sample of size N, with three variables: x1, x2, and
>> x3, all of them are zero/one dummies. Further, for any observation:
>> x1+x2+x3=1.  What i am interested is m=sum(x1)/sum(x2), or
>> equivalently m=mean(x1)/mean(x2).  how can i use stata bootstrap
>> command to estimate standard errors for m?
>
> The estimate m you are asking for is sometimes called a relative risk
> or sometimes an odds. Whatever you call it, it can be estimated as the
> exponentiated constant of a multinomial logit model without
> covariates. Once you know that, computing regular, robust, bootstrap,
> jackknife standard errors is just a matter of specifying the -vce()-
> option inside -mlogit-:
>
> *------------------ begin example ------------------
> sysuse nlsw88, clear
>
> // lets compute that odds manually:
> sum married
> tempname m_married
> scalar `m_married' = r(mean)
> sum never_married
> di as txt "manually computed odds: " ///
>    as result `m_married'/r(mean)
>
> // use mlogit to compute those odds:
> gen byte marst = !never_married + married  ///
>     if !missing(never_married, married)
> label variable marst "marital status"
> label define marst 0 "never married"       ///
>                    1 "divorced or widowed" ///
>                    2 "married"
> label value marst marst
>
> mlogit marst, base(0) rrr
>
> // do the bootstrap
> mlogit marst, base(0) rrr vce(bootstrap, reps(100))
> *------------------- end example -------------------
> * (For more on examples I sent to the Statalist see:
> * http://www.maartenbuis.nl/example_faq )
>
> Hope this helps,
> Maarten
>
> ---------------------------------
> Maarten L. Buis
> WZB
> Reichpietschufer 50
> 10785 Berlin
> Germany
>
> http://www.maartenbuis.nl
> ---------------------------------
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/



--
Shuaizhang Feng
https://sites.google.com/site/shuaizhangfeng/


-- 
Shuaizhang Feng
https://sites.google.com/site/shuaizhangfeng/
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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