0
$\begingroup$

I need to compare dependent samples (matched-pairs) from the same group in 2 time frames, simply a hypothesis test to determine if there is any statistically significant difference pre and post an intervention. So likely a paired-t or a signed rank test depending on sample size and shape of the distribution.

The problem I have is that the time frames are of different lengths:

  • most of the baseline (pre) is 1 year, bar one individual who has ~ 6 months
  • the post dataset ranges between 2-3 years
  • the data to be compared is frequency, so counts of instances in the timeframe, and duration of each instance

What is the most statistically sound method normalize the data and compare the data from these 2 time frames?

With frequency I was thinking maybe mean per week or month, and duration just mean.

$\endgroup$

1 Answer 1

0
$\begingroup$

I would suggest learning about generalized linear mixed effects models (there is much more to be learned than can be covered in a forum like this, take a class or at least an online tutorial).

For counts you can do a Poisson regression (or negative binomial) and the duration can use a normal or gamma regression model. The pairs then become the random effects and your pre/post (and any other covariates) are the fixed effects. Difference in time periods can be accounted for with offsets.

Another option would be a Bayesian hierarchical model where the "fixed" effects parameters would each have a prior, but the paired/random parameters (probably start with per person intercepts, but could explore more complicated models) would come from a distribution with a hyper prior. Again you would need at least a course (or a few) to do this properly.

$\endgroup$
5
  • $\begingroup$ Thanks, although a poisson regression should be for independent variables. No? Also, could you elaborate what you mean when you refer to "offsets"? I'm correctly considering classes for fall semester so I will keep those in mind. $\endgroup$
    – John Conor
    Commented Apr 26, 2022 at 16:24
  • $\begingroup$ I'm not trying to make any predictions from this particular dataset, just a hypothesis test to determine if there is any statistically significant difference pre and post intervention. My goal for the question is to determine how to best normalize the 2 data sets covering different lengths of time. $\endgroup$
    – John Conor
    Commented Apr 26, 2022 at 16:27
  • $\begingroup$ I have updated the question to better reflect @Greg Snow $\endgroup$
    – John Conor
    Commented Apr 26, 2022 at 16:32
  • $\begingroup$ @JohnConor, a regular Poisson regression should be for independent values, but the mixed effects version accounts for the pairing with the random effects. A 2-sample t-test is a special case of linear regression, a paired t-test is a special case of a linear mixed effects model. The same relationship works with Poisson regression. Offsets are terms in a model that do not have an estimated coefficient (just added as is), in Poisson regressions these are used to account for different sizes of time frames for counts. $\endgroup$
    – Greg Snow
    Commented Apr 26, 2022 at 17:13
  • $\begingroup$ Thanks @Greg Snow. That's very helpful. In stats the classes I've taken so far I hadn't heard of, or thought of, t-tests as linear models. I appreciate you connecting the dots. Evidently I have a lot more to learn :) I'll take a look at the mixed effects poisson regression. $\endgroup$
    – John Conor
    Commented Apr 26, 2022 at 17:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.