Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • T-test with survey data

    Hello. I am using survey data:

    gen fs_strata = state + sector + stratum + sub_stratum
    svyset fsu_serial_no [pweight=weights], strata(fs_strata) singleunit(centered) || hhid

    I am comparing hospitalization expenditures among two types of houhseholds is_hhmem_pmjay ==1 and is_hhmem_pmjay ==0. I have obtained that the first households spend more than the later ones.
    I would like to know if that difference is statistically significant.

    I have donde the following:

    svy: regress hosp_exp i.is_hhmem_pmjay

    Output:

    . svy: regress hosp_exp i.is_hhmem_pmjay
    (running regress on estimation sample)

    Survey: Linear regression

    Number of strata = 75 Number of obs = 1,382
    Number of PSUs = 1,272 Population size = 1,521,963
    Design df = 1,197
    F( 1, 1197) = 2.56
    Prob > F = 0.1100
    R-squared = 0.0045

    ----------------------------------------------------------------------------------
    | Linearized
    hosp_exp | Coef. Std. Err. t P>|t| [95% Conf. Interval]
    -----------------+----------------------------------------------------------------
    1.is_hhmem_pmjay | 8475.219 5299.549 1.60 0.110 -1922.22 18872.66
    _cons | 26223.55 1539.171 17.04 0.000 23203.78 29243.32
    ----------------------------------------------------------------------------------
    Note: Strata with single sampling unit centered at overall mean.


    ....and as the data is skewed, I have done this:

    gen ln_hosp_exp = ln(hosp_exp) if hosp_exp>0

    svy: regress ln_hosp_exp i.is_hhmem_pmjay



    svy: regress ln_hosp_exp i.is_hhmem_pmjay
    (running regress on estimation sample)

    Survey: Linear regression

    Number of strata = 75 Number of obs = 1,382
    Number of PSUs = 1,272 Population size = 1,521,963
    Design df = 1,197
    F( 1, 1197) = 1.06
    Prob > F = 0.3040
    R-squared = 0.0011

    ----------------------------------------------------------------------------------
    | Linearized
    ln_hosp_exp | Coef. Std. Err. t P>|t| [95% Conf. Interval]
    -----------------+----------------------------------------------------------------
    1.is_hhmem_pmjay | .108841 .1058323 1.03 0.304 -.0987965 .3164784
    _cons | 9.256737 .0591909 156.39 0.000 9.140607 9.372866
    ----------------------------------------------------------------------------------
    Note: Strata with single sampling unit centered at overall mean.


    Is this correct ? how can I run a t-test on this survey data?

    Thank you,

  • #2
    The classic t-test (-ttest-) does not support survey estimation (-svy:- prefix), however a t-test is a special case of a linear regression with a single binary predictor. The regression command you show is correct for the survey-adjusted analogue of a t-test. I make no judgements about whether log-transformation is correct, though it's common enough to do this for expenditure data.

    Comment


    • #3
      Silvana:
      as an aside to Leonardo's helpful reply, I find weird that a simple OLS (that is, an OLS with one regressor only) (or a -ttest-) is enough.
      R-sq is, as expected, really low and you cannot exclude that the difference between the two households is zero (95% CI of the predictor -.0987965 .3164784).
      Kind regards,
      Carlo
      (Stata 19.0)

      Comment


      • #4
        Dear Leonardo and Carlo,
        Thank you for your clear replies!

        Comment

        Working...
        X