Let's assume I want to see if the acute effect of smoking on heart rate varies according to flavor (menthol vs. no flavor) in two groups (hypertensive vs. non-hypertensive).
In a within-subject randomized (according to flavor) controlled trial, the change in heart rate of the 20 individuals was measured upon using menthol cigarettes and again with non-menthol cigarettes.
Considering the within and between-subject variability in heart rate and other confounders, I considered a linear mixed model to see if the change is bigger upon using menthol cigarettes in hypertensive individuals.
Is it the correct code for Stata? If not, can you please suggest the correct one? And what other things do I need to consider here?
Please note, the data is in long format.
Thanks in advance.
In a within-subject randomized (according to flavor) controlled trial, the change in heart rate of the 20 individuals was measured upon using menthol cigarettes and again with non-menthol cigarettes.
Considering the within and between-subject variability in heart rate and other confounders, I considered a linear mixed model to see if the change is bigger upon using menthol cigarettes in hypertensive individuals.
Is it the correct code for Stata? If not, can you please suggest the correct one? And what other things do I need to consider here?
Code:
xtmixed heart_rate hypertension var1 var2 || flavor:||individual_id:
Thanks in advance.
Comment