Statalist


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

Re: st: Time series quadrature error


From   Clive Nicholas <[email protected]>
To   [email protected]
Subject   Re: st: Time series quadrature error
Date   Fri, 2 Oct 2009 20:03:09 +0100

Mark Ludwig replied to Austin Nichols:

> Here's what I get when I try Austin Nichols' suggestion. The crux of the
> problem seems to be that when I try to create lags, it generates missing
> observations.
>
>  sort id date
>
> .. tsset id date, monthly
>       panel variable:  id (weakly balanced)
>        time variable:  date, 2007m7 to 2008m11
>                delta:  1 month
>
> ..
> .. loc v "war income male PID education L.war_casualties L.dem_iraq_email
> L.GOP_iraq_email L.dem_
>> iraq_web L.GOP_iraq_web L.media_iraq"
>
> .. su `v' if tin(2007m9, 2008m3)

[...]

You didn't answer my previous question, but here's what I get using
some toy data from Stata 9.2 (something you were also asked to do, but
didn't):

. webuse quad1

. bysort id: g time=_n

. tsset id time, monthly
       panel variable:  id (strongly balanced)
        time variable:  time, 1960m2 to 1961m9

. g x7=invnorm(uniform())

. g x8=invnorm(uniform())*-10

. g x9=invnorm(uniform())^2

. xtlogit z x7 x8 x9 l.x8 l.x9 if tin(1960m2,1961m9)

Fitting comparison model:

Iteration 0:   log likelihood = -3944.2542
Iteration 1:   log likelihood =   -3943.45
Iteration 2:   log likelihood =   -3943.45

Fitting full model:

tau =  0.0     log likelihood =   -3943.45

[...]

tau =  0.8     log likelihood = -3225.5103

Iteration 0:   log likelihood =  -3206.189
Iteration 1:   log likelihood = -3203.0869
Iteration 2:   log likelihood = -3203.0812
Iteration 3:   log likelihood = -3203.0812

Random-effects logistic regression              Number of obs      =      5700
Group variable (i): id                          Number of groups   =       300

Random effects u_i ~ Gaussian                   Obs per group: min =        19
                                                               avg =      19.0
                                                               max =        19

                                                Wald chi2(5)       =      3.65
Log likelihood  = -3203.0812                    Prob > chi2        =    0.6014

------------------------------------------------------------------------------
           z |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
          x7 |   .0190738   .0332985     0.57   0.567      -.04619    .0843375
          x8 |   .0018772   .0032997     0.57   0.569      -.00459    .0083444
          x9 |   .0269834    .024339     1.11   0.268    -.0207202     .074687
          x8 |
         L1. |  -.0011123   .0032993    -0.34   0.736    -.0075789    .0053542
          x9 |
         L1. |   .0335917   .0247367     1.36   0.174    -.0148914    .0820748
       _cons |   .0850576   .1091967     0.78   0.436    -.1289641    .2990792
-------------+----------------------------------------------------------------
    /lnsig2u |   1.028655   .1077276                       .817513    1.239797
-------------+----------------------------------------------------------------
     sigma_u |   1.672514   .0900879                      1.504945     1.85874
         rho |   .4595406   .0267556                      .4077355     .512235
------------------------------------------------------------------------------
Likelihood-ratio test of rho=0: chibar2(01) =  1480.74 Prob >= chibar2 = 0.000

It could well be that -xtlogit- doesn't like weakly balanced
time-series data, or (more likely) it could be because of the
particularities of your own longitudinal survey dataset.

-- 
Clive Nicholas

[Please DO NOT mail me personally here, but at
<[email protected]>. Please respond to contributions I make in
a list thread here. Thanks!]

"My colleagues in the social sciences talk a great deal about
methodology. I prefer to call it style." -- Freeman J. Dyson.

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index