Announcement

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

  • Compare two groups at baseline before an intervention is implemented

    Greetings all,

    How do you compare two groups in stata? Is it with ttest? I hope to compare two groups at baseline before an intervention is implemented.

    Regards!

  • #2
    You don't say what you want to compare across the two groups. It makes a huge difference.

    If you want compare the two groups on the study outcome variable at baseline, and if the outcome is a continuous one, and the sample is large (or, in a small sample, the values are normally distributed in each group) then, yes you can do a t-test. But if you also want to look at intervention effects in the same study, then it is better to do everything at once. One group is going to receive the intervention and the other will be a control group, do I have that right? If so, you need two variables:

    1. A time-dichotomy that is 0 at baseline and 1 at follow-up in both groups. Let's call that one time.
    2. A group-dichotomy that is 0 in the control group and 1 in the intervention group (this being true in both the baseline and follow-up observations.)

    Then you do
    Code:
    regress outcome_variable i.group##i.time // PERHAPS SOME COVARIATES
    margins time, dydx(group)
    The output of -margins- in the time = 0 row will be the baseline difference in expected outcome between groups. In the time = 1 row it will be the difference in expected outcome between groups at follow-up. You can also estimate the treatment effect by looking at the regression output table for the 1.group#1.time row.


    On the other hand, if you are checking to see if they are sufficiently comparable on non-outcome variables at baseline that one group serves as a reasonable control for the other, looking for similarity in, say, age, sex distribution, etc., then hypothesis testing is not relevant and descriptive statistics are appropriate. So just using -summarize- (continuous variables) and -tabulate- (discrete variables) in the two groups is more appropriate for this purpose. You will often see p-values associated with these comparisons in published articles, but p-values are only appropriate for testing hypotheses about group differences--so they answer the wrong question in this setting. (And if the two groups were set up by a randomization method that was appropriately designed and implemented, p-values are doubly wrong because then they fail to even test a hypothesis--in a randomized study any "significant" result is, by definition, a Type I error.) Whether the groups differ enough that adjustment for potential confounding is appropriate depends on the magnitudes of the group differences in the sample and on how strongly the potentially confounding variables are associated with the outcome. Neither of those things is quantified using p-values or hypothesis tests; and in fact non-significant differences may well be large enough to call for confounding, and significant differences may have no important confounding effect. So be sure not to confuse hypothesis testing with assessing potential confounding.

    Comment

    Working...
    X