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: Mlogit: Variance Matrix nonsymmetric after bsample
From
Stas Kolenikov <[email protected]>
To
"[email protected]" <[email protected]>
Subject
Re: st: Problem: Mlogit: Variance Matrix nonsymmetric after bsample
Date
Wed, 2 Oct 2013 08:52:56 -0500
Why do you think bootstrapping is going to give you more robust
results? Justifications of the bootstrap are all asymptotic. If you
want to extract higher precision of your confidence intervals, then
you need to bootstrap the t-statistics and then apply the bootstrap
distribution of the t-statistic to what's produced on the base sample
(which -bootstrap- does not do at the moment, although arguably it
should -- consider this a feature request for Stata 14 :) ).
Having said that, I think the major problem with your code is that
-restore, preserve- should be within the cycle, so that you -bsample-
the original data again and again. What you do right now is:
set seed 111111
sysuse auto, clear
tab rep
bsample
tab rep
bsample
tab rep
bsample
tab rep
As you see, you have successfully destroyed the least populated group
of rep78==1 after just three -bsample-s.
-- Stas Kolenikov, PhD, PStat (ASA, SSC)
-- Senior Survey Statistician, Abt SRBI
-- Opinions stated in this email are mine only, and do not reflect the
position of my employer
-- http://stas.kolenikov.name
On Wed, Oct 2, 2013 at 8:05 AM, <[email protected]> wrote:
> Dear Statalist,
>
> I would greatly appreciate your help.
>
> I am currently trying predict the contrafactual probability of nonvoters to
> vote for a certain party. I am using a mlogit-model with interaction effects
> and difficult technique estimations options. To get more robust results, I
> want bootstrapped predictions using bsample.
> For some reason, if using bsample, after about 5 repetitions with the random
> samples, the mlogit-model isn't concave anymore, but apparently still
> converges. There's a warning message saying Variance Matrix nonsymmetric or
> highly singular. This results in very strange coefficients, which are still
> predicted und thus ruin the results.
> I read that this might be due to the fact that there are not enough cases
> with some sparse indicator variables. Therefore i tried reducing the
> categories in some variables, with no effect. Using the total option to see
> which variables produce empty cells doesn't help either.
>
> I therefore used capture and e(p) so only regression samples w/ meaningful
> coeff. are included. This shows that only the first seven examples are
> meaningful. How can that be and what to do about it?
>
> Thank you very much!
>
> Here the code used (stata 10):
>
> preserve
> set seed 731
>
>
> forv i = 1/200 {
> bsample, strata(Wä)
>
> // Loop over dates and surveys
>
>
> // Estimate model
> capture mlogit party _I* [pweight=wei_ipfges_2] if party <=
> 5, difficult technique(nr 15 bhhh 15 dfp 15 bfgs 15) base(1)
>
> if e(p)~= . {
>
> // Predict
> predict Phat1 Phat2 Phat3 Phat4 Phat5 if Wä == 0
>
> // Post
> forv j = 1/5 {
> sum Phat`j' [aw=wei_ipfges_2] if Wä==0,
> meanonly
> post `CI' (`j') (r(mean))
> }
>
> drop Phat*
> }
> }
>
> restore,preserve
>
>
> postclose `CI'
>
> exit
>
>
> *
> * 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/
*
* 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/