Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: statistical test to compare two survey means from two estimatingequations


From   [email protected]
To   [email protected]
Subject   Re: st: statistical test to compare two survey means from two estimatingequations
Date   Tue, 5 Dec 2006 11:27:26 -0500

Brent Fulton asked:--


> > I've run the following and can examine if the e.g., 95% CI's overlap, 
but
> > would like to calculate the p-value that the means are equal.
> > .svy: mean y
> > .svy: mean y, subpop(Michigan_dummy)
> >
> > Is there a post-estimation test that can compare the survey-based 
means
> > above?


How about -suest- followed by -test-.  Below is an example comparing the 
proportion obese (0=nonobese, 1=obese) for the US vs. Michigan.  The data 
come from a national telephone survey.  The test is first done using 
-svy:regress- (constant only model), then using -svy:logit- (constant only 
model).


 svyset [pweight=finalwt2];

      pweight: finalwt2
          VCE: linearized
     Strata 1: <one>
         SU 1: <observations>
        FPC 1: <zero>

. svy: reg bmi2;
(running regress on estimation sample)

Survey: Linear regression

Number of strata   =         1                  Number of obs      = 2764
Number of PSUs     =      2764                  Population size    = 
1.240e+08
                                                Design df          = 2763
                                                F(   0,   2763)    =   .
                                                Prob > F           =   .
                                                R-squared          = 
0.0000

------------------------------------------------------------------------------
             |             Linearized
        bmi2 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. 
Interval]
-------------+----------------------------------------------------------------
       _cons |   .1924716   .0085171    22.60   0.000      .175771 
.2091722
------------------------------------------------------------------------------

. estimates store a1;

. svy, subpop(mi): reg bmi2;
(running regress on estimation sample)

Survey: Linear regression

Number of strata   =         1                  Number of obs      = 2764
Number of PSUs     =      2764                  Population size    = 
1.240e+08
                                                Subpop. no. of obs =  96
                                                Subpop. size       = 
3992188.9
                                                Design df          = 2763
                                                F(   0,   2763)    =   .
                                                Prob > F           =   .
                                                R-squared          = 
0.0000

------------------------------------------------------------------------------
             |             Linearized
        bmi2 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. 
Interval]
-------------+----------------------------------------------------------------
       _cons |   .1587098   .0388779     4.08   0.000     .0824771 
.2349425
------------------------------------------------------------------------------

. estimates store a2;

. suest a1 a2;

Simultaneous survey results for a1, a2

Number of strata   =         1                  Number of obs      = 2764
Number of PSUs     =      2764                  Population size    = 
1.240e+08
                                                Design df          = 2763

------------------------------------------------------------------------------
             |             Linearized
             |      Coef.   Std. Err.      t    P>|t|     [95% Conf. 
Interval]
-------------+----------------------------------------------------------------
a1           |
       _cons |   .1924716   .0085171    22.60   0.000      .175771 
.2091722
-------------+----------------------------------------------------------------
a2           |
       _cons |   .1587098   .0388779     4.08   0.000     .0824771 
.2349425
------------------------------------------------------------------------------

. test [a1]_cons=[a2]_cons;

Adjusted Wald test

 ( 1)  [a1]_cons - [a2]_cons = 0

       F(  1,  2763) =    0.77
            Prob > F =    0.3812

. svy: logit bmi2;
(running logit on estimation sample)

Survey: Logistic regression

Number of strata   =         1                  Number of obs      = 2764
Number of PSUs     =      2764                  Population size    = 
1.240e+08
                                                Design df          = 2763
                                                F(   0,   2763)    =   .
                                                Prob > F           =   .

------------------------------------------------------------------------------
             |             Linearized
        bmi2 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. 
Interval]
-------------+----------------------------------------------------------------
       _cons |   -1.43403   .0547986   -26.17   0.000     -1.54148 
-1.326579
------------------------------------------------------------------------------

. estimates store a3;

. svy, subpop(mi): logit bmi2;
(running logit on estimation sample)

Survey: Logistic regression

Number of strata   =         1                  Number of obs      = 2764
Number of PSUs     =      2764                  Population size    = 
1.240e+08
                                                Subpop. no. of obs =  96
                                                Subpop. size       = 
3992188.9
                                                Design df          = 2763
                                                F(   0,   2763)    =   .
                                                Prob > F           =   .

------------------------------------------------------------------------------
             |             Linearized
        bmi2 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. 
Interval]
-------------+----------------------------------------------------------------
       _cons |  -1.667859   .2911746    -5.73   0.000    -2.238801 
-1.096918
------------------------------------------------------------------------------

. estimates store a4;

. suest a3 a4;

Simultaneous survey results for a3, a4

Number of strata   =         1                  Number of obs      = 2764
Number of PSUs     =      2764                  Population size    = 
1.240e+08
                                                Design df          = 2763

------------------------------------------------------------------------------
             |             Linearized
             |      Coef.   Std. Err.      t    P>|t|     [95% Conf. 
Interval]
-------------+----------------------------------------------------------------
a3           |
       _cons |   -1.43403   .0547986   -26.17   0.000     -1.54148 
-1.326579
-------------+----------------------------------------------------------------
a4           |
       _cons |  -1.667859   .2911746    -5.73   0.000    -2.238801 
-1.096918
------------------------------------------------------------------------------

. test [a3]_cons=[a4]_cons;

Adjusted Wald test

 ( 1)  [a3]_cons - [a4]_cons = 0

       F(  1,  2763) =    0.66
            Prob > F =    0.4172



****************************************************************
Michael R. Frone, Ph.D.
Senior Research Scientist
Research Institute on Addictions
State University of New York at Buffalo
1021 Main Street
Buffalo, New York 14203

Office:    716-887-2519
Fax:        716-887-2477
E-mail:     [email protected]
Internet: http://www.ria.buffalo.edu/profiles/frone.html
****************************************************************



*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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