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
Maarten Buis <[email protected]>
To
[email protected]
Subject
Re: st: Problem: Mlogit: Variance Matrix nonsymmetric after bsample
Date
Wed, 2 Oct 2013 15:49:28 +0200
I would start by reloading the original dataset at the beginning of
each iteration. Otherwise you are sampling from a sample of a sample
of a sample ... of the data.
Hope this helps,
Maarten
On Wed, Oct 2, 2013 at 3:05 PM, <[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/
--
---------------------------------
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/