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

# st: RE: SE/CI for difference in transition matrix row proportions after -svy tabulate- twoway

 From To Subject st: RE: SE/CI for difference in transition matrix row proportions after -svy tabulate- twoway Date Wed, 4 Apr 2012 11:08:52 +0100

```------------------------------

Date: Tue, 3 Apr 2012 17:32:11 +0000
From: "Scholes, Shaun" <s.scholes@ucl.ac.uk>
Subject: st: RE: SE/CI for difference in transition matrix row
proportions after -svy tabulate- twoway

I'm having an early evening junior moment (and about to log off) but
could you not:

svy: mean bu_SA, over(Lbu_SA)

and use lincom to estimate the difference, and obtain SE/CIs for the
difference using that?

Best wishes
Shaun
------------------------------------
Oh to have junior moments!  Shaun: thanks, your suggestion provides a
solution for me.

Here's an illustration using the union data set:

. webuse union, clear
(NLS Women 14-24 in 1968)

. svyset idcode

pweight: <none>
VCE: linearized
Single unit: missing
Strata 1: <one>
SU 1: idcode
FPC 1: <zero>

. ge byte Lunion = L.union
(16639 missing values generated)

. svy: tabulate Lunion union, row se
(running tabulate on estimation sample)

Number of strata   =         1                  Number of obs      =
9561
Number of PSUs     =      3621                  Population size    =
9561
Design df          =
3620

-------------------------------------
|        1 if union
Lunion |       0        1    Total
----------+--------------------------
0 |   .9203    .0797        1
| (.0033)  (.0033)
|
1 |   .2645    .7355        1
| (.0109)  (.0109)
|
Total |   .7741    .2259        1
| (.0064)  (.0064)
-------------------------------------
Key:  row proportions
(linearized standard errors of row proportions)

Pearson:
Uncorrected   chi2(1)         = 4073.6377
Design-based  F(1, 3620)      = 3197.8295     P = 0.0000

. svy: mean union, over(Lunion)
(running mean on estimation sample)

Survey: Mean estimation

Number of strata =       1          Number of obs    =    9561
Number of PSUs   =    3621          Population size  =    9561
Design df        =    3620

0: Lunion = 0
1: Lunion = 1

--------------------------------------------------------------
|             Linearized
Over |       Mean   Std. Err.     [95% Conf. Interval]
-------------+------------------------------------------------
union        |
0 |   .0796877   .0033145      .0731892    .0861862
1 |   .7354597    .010891      .7141066    .7568127
--------------------------------------------------------------

. lincom [union]1 - [union]0

( 1)  - [union]0 + [union]1 = 0

------------------------------------------------------------------------
------
Mean |      Coef.   Std. Err.      t    P>|t|     [95% Conf.
Interval]
-------------+----------------------------------------------------------
------
(1) |    .655772   .0115293    56.88   0.000     .6331673
.6783766
------------------------------------------------------------------------
------

. ret list

scalars:
r(df) =  3620
r(se) =  .0115293178519787
r(estimate) =  .6557719519645262

- -----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of
S.Jenkins@lse.ac.uk
Sent: 03 April 2012 18:13
To: statalist@hsphsun2.harvard.edu
Subject: st: SE/CI for difference in transition matrix row proportions
after -svy tabulate- twoway

I'm having an early evening senior moment, and can't figure out how to
calculate, from saved results after -svy tabulate-, the difference
between two elements of a 2x2 transition matrix and the associated
SE/CI. I've been browsing svy help and documentation, and can't find the
answer directly. Part of my problem is not understanding precisely what
is stored in the saved variance-covariance matrix.

Below is example output from a simplified example. I have a binary
measure of receipt at t-1 and at t, and cross-tabulate them. The two
transition proportions of interest are the entry rate, P(0,1), which is
estimated to be 0.0335 in the example, and the stayer rate, P(1,1),
which is estimated to be 0.6553 in the example. I want not only the the
difference P(1,1) - P(0,1), but also a SE/CI for the difference, which I
was assuming I could calculate from the saved results. Suggestions

. svy: tabulate Lbu_SA bu_SA, row se
(running tabulate on estimation sample)

Number of strata   =         1                  Number of obs      =
75988
Number of PSUs     =      9036                  Population size    =
75988
Design df          =
9035

- -------------------------------------------
1:R's BU  |
IS|UBIS|U |
t-1       |         0          1      Total
- ----------+--------------------------------
0 |     .9665      .0335          1
| (8.2e-04)  (8.2e-04)
|
1 |     .3447      .6553          1
|   (.0095)    (.0095)
|
Total |     .9255      .0745          1
|   (.0023)    (.0023)
- -------------------------------------------
Key:  row proportions
(linearized standard errors of row proportions)

Pearson:
Uncorrected   chi2(1)         =  2.62e+04
Design-based  F(1, 9035)      =  1.47e+04     P = 0.0000

. mat list e(b)

e(b)[1,4]
p11        p12        p21        p22
y1  .96649524  .03350476  .34470377  .65529623

. mat list e(V_row)

symmetric e(V_row)[2,2]
r1:         r2:
r1          r1
r1:r1   4.394e-06
r2:r1  -4.394e-06   4.394e-06

. mat list e(V)

symmetric e(V)[4,4]
p11         p12         p21         p22
p11   6.751e-07
p12  -6.751e-07   6.751e-07
p21   1.477e-07  -1.477e-07   .00008959
p22  -1.477e-07   1.477e-07  -.00008959   .00008959

Stephen
------------------
Professor Stephen P. Jenkins <s.jenkins@lse.ac.uk>
Department of Social Policy and STICERD
London School of Economics and Political Science
Houghton Street, London WC2A 2AE, UK
Tel: +44(0)20 7955 6527
Changing Fortunes: Income Mobility and Poverty Dynamics in Britain, OUP
2011, http://ukcatalogue.oup.com/product/9780199226436.do
Survival Analysis Using Stata:
http://www.iser.essex.ac.uk/survival-analysis