Announcement

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

  • Statistical Test for Continuous Variable Differences Between Study Groups that Accepts Probability Weights?

    Hi all,

    I'm constructing a table that shows differences in baseline characteristics between four study groups, before and after probability weighting. I've used chi-square tests for categorical variables using -svyset- and can get p-values for group differences before and after probability weighting.

    However, I am struggling to figure out what to do with the two continuous variables I have remaining. The study I've modelled my design after has two groups and used the Wilcoxon Rank-Sum Test. This test, however, doesn't work with more than two groups and I have four. The Kruskal-Wallis test seems to be the multiple group equivalent to the Wilcoxon, but Stata's implementation doesn't work with probability weighted data (it also doesn't store p-values anywhere preventing the use of any of Stata 17's nifty table building functionality). My supervisor suggested looking at statistical tests that look at differences in means - I thought an ANOVA using -oneway- might be in order, but this, too, doesn't work with probability weights.

    My question: what options are available to me in Stata to test for between study group differences with a continuous variable before and after applying probability of treatment weights?

    Thank you!

  • #2
    regress allows pweights and it can test for differences between multiple means, directly analogously to one-way ANOVA.

    .ÿ
    .ÿversionÿ17.0

    .ÿ
    .ÿclearÿ*

    .ÿ
    .ÿ//ÿseedem
    .ÿsetÿseedÿ1616348357

    .ÿ
    .ÿquietlyÿsetÿobsÿ21

    .ÿgenerateÿdoubleÿoutÿ=ÿrnormal()

    .ÿgenerateÿbyteÿtrtÿ=ÿmod(_n,ÿ3)

    .ÿgenerateÿdoubleÿwgtÿ=ÿruniform()

    .ÿ
    .ÿ*
    .ÿ*ÿBeginÿhere
    .ÿ*
    .ÿregressÿoutÿi.trtÿ[pweight=wgt]
    (sumÿofÿwgtÿisÿ10.75111362720727)

    LinearÿregressionÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNumberÿofÿobsÿÿÿÿÿ=ÿÿÿÿÿÿÿÿÿ21
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿF(2,ÿ18)ÿÿÿÿÿÿÿÿÿÿ=ÿÿÿÿÿÿÿ2.26
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿProbÿ>ÿFÿÿÿÿÿÿÿÿÿÿ=ÿÿÿÿÿ0.1334
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿR-squaredÿÿÿÿÿÿÿÿÿ=ÿÿÿÿÿ0.1055
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿRootÿMSEÿÿÿÿÿÿÿÿÿÿ=ÿÿÿÿÿÿ.8916

    ------------------------------------------------------------------------------
    ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿRobust
    ÿÿÿÿÿÿÿÿÿoutÿ|ÿCoefficientÿÿstd.ÿerr.ÿÿÿÿÿÿtÿÿÿÿP>|t|ÿÿÿÿÿ[95%ÿconf.ÿinterval]
    -------------+----------------------------------------------------------------
    ÿÿÿÿÿÿÿÿÿtrtÿ|
    ÿÿÿÿÿÿÿÿÿÿ1ÿÿ|ÿÿÿ-.516286ÿÿÿÿ.552736ÿÿÿÿ-0.93ÿÿÿ0.363ÿÿÿÿ-1.677541ÿÿÿÿ.6449692
    ÿÿÿÿÿÿÿÿÿÿ2ÿÿ|ÿÿÿÿ.282994ÿÿÿÿ.497681ÿÿÿÿÿ0.57ÿÿÿ0.577ÿÿÿÿ-.7625949ÿÿÿÿ1.328583
    ÿÿÿÿÿÿÿÿÿÿÿÿÿ|
    ÿÿÿÿÿÿÿ_consÿ|ÿÿ-.1840751ÿÿÿ.4535533ÿÿÿÿ-0.41ÿÿÿ0.690ÿÿÿÿ-1.136955ÿÿÿÿÿ.768805
    ------------------------------------------------------------------------------

    .ÿtestparmÿi.trt

    ÿ(ÿ1)ÿÿ1.trtÿ=ÿ0
    ÿ(ÿ2)ÿÿ2.trtÿ=ÿ0

    ÿÿÿÿÿÿÿF(ÿÿ2,ÿÿÿÿ18)ÿ=ÿÿÿÿ2.26
    ÿÿÿÿÿÿÿÿÿÿÿÿProbÿ>ÿFÿ=ÿÿÿÿ0.1334

    .ÿ
    .ÿexit

    endÿofÿdo-file


    .

    Comment


    • #3
      Thanks Joseph, I will give this a try!

      Comment

      Working...
      X