Announcement

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

  • Between and within subject regression

    Let’s assume I want to see the change in blood pressure(bp) after exercise sessions in two groups [between subject variable] after adjusting for age and gender.
    The data are in long format.
    bp=outcome variable (continuous), id=identifying variable, health=grouping variable(healthy vs unhealthy), age=independent variable(continuous) and gender=independent variable(male vs female).
    What would be the command for running a regression? Linear mixed effect model?

    Thanks in advance.

  • #2
    Ray:
    welcome to this forum.
    If you have one wave of data only (that is, the difference in BP) as it is often the case with the so-called mirror studies (in which the participant acts as her/his control), you may want to consider an OLS:
    Code:
    regress diff_BP i.group c.age##c.age
    The -age- interaction aims at exploring possibe non-linear relationship with the regressand.
    Last edited by Carlo Lazzaro; 30 May 2023, 00:36.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Thanks for the reply.
      What if I want to compare the pre and post-session blood pressure, not the difference? and don't we need to specify the within and between subject variables?
      What about the linear mixed effect model?

      xtmixed c.outcome group independent ||group:time_variable||participant_id:, cov(uns)

      Comment


      • #4
        Ray:
        thanks for clarifying.
        Basically, you seem to have a panel dataset with two waves of data.
        I think that you can go -xtreg,fe- and -xtreg,re- and see which one fits your dataset better via -hausman- (if you use default standard errors).
        -mixed- can be another option, provided that it is a cousin of -xtreg, mle- (that is a random effect estimator).
        In addition, the dependent variable does not support -fvvarlist- notation (that is, you shoul code -outcome- instead of -c.outcome-).
        Last edited by Carlo Lazzaro; 30 May 2023, 11:50.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment

        Working...
        X