We completed an RCT study where participants were from 20 different clusters in each of the intervention and control group. We want to measure the effect size for outcome variable and explanatory variable adjusting the clustering effect.
In SPSS you can use the GENLIN-procedure (Analyze / Generalized linear models / Generalized estimating equations) and in Stata you can use 'xtgee' after setting up your data with 'xtset'.
For more details on how to conduct the analysis you should consider: 1) what is the measurement scale of your primary outcome and 2) how many time-points the RCT covered (or did you measure time in a continuous fashion), but here is a template for conducting the analysis in Stata (fill in the parts enclosed in square brackets according to your data) assuming you had k waves of measurements:
I included the category expansion function (i.) for the time variable, as I am not sure how many waves you are dealing with. If just two (baseline vs. follow-up) you can use a 0/1 (BL, FU) dummy. The group variable is assumed to be coded are 0/1 (control/intervenion). See Stata help on xtgee for more options on the outcome variable distribution, in case the outcome is measured on some other scale, e.g. a binary variable.
For example, if the variables in the data file were as follows:
ID cluster (patient) identification
T time variable
G intervention group variable (for two groups, only)
OUT outcome variable
then you could use the commands to execute the analysis:
stset ID T
xi: xtgee OUT G i.T i.G*T, cor(uns) family(gaussian)
Note that while the unstructured (uns) correlation structure is the most accommodating, it is the heaviest on computing burden and can even fail in some cases and variable types. However, since you are dealing with RCT data your design should be sufficiently balanced for a smooth analysis (at least for a continuous outcome).
Thank you Timo Törmäkangas ! This was very helpful. I have one further query, if we are comparing only one point of time between two groups for clustered data, how would be this?