I want to do an analysis of transition frequencies in a placebo controlled sleep study, but I don`t know how to do it. I`m using Stata 15.1 for Windows.
I have read about the command xttrans which I think can be used, but I can`t figure out how to use it on my dataset and how the command eventually can be combined with contrast analysis. I`m a new STATA user.
Setting: This is a sleep study of 15 COPD patients, and patients receive a placebo and a drug intervention on separate nights.
The substantive problem is this: Patients fluctuate between wakefullness, REM sleep and non-REM (NREM) sleep many times during the night. The idea is that the drug intervention may have altered the dynamics of transitions between sleep stages (sleep architecture). An alteration in transition pattern between sleep stages during drug intervention nights may suggest that that the normal continuation of sleep is disrupted.
I would like to compare the mean percentage of transitions between sleep stages during placebo with the mean percentage of transitions between sleep stages during drug intervention.
I assume this can be achieved by a combination of transition analysis and a MANOVA test for contrast analysis.
I think it is meaningful both to calculate a global relative transition frequency and a normed relative transition frequency. The global relative transition frequency can be calculated by dividing the number of transitions between sleep stages by the total number of all transitions. Next, the normed relative transition frequency can be calculated by dividing the number of transitions from the specific stage to one of the other stages by the total number of transitions from the specific stage to another stage.
If possible I`m also interested in analyzing both stage specific transitions and overall transitions every hour into measurement (and overall transition frequency for the whole night).
I think it will be useful to present the calculated mean values of transition percentages as bars (with standard deviations), and I`m grateful for suggestions and help on this issue too.
Technical notes;
The total measurement duration (sleep duration) are different between individuals and also within individuals during the placebo and the drug intervention nights. Therefore the number of epochs are different from subject to subject (unbalanced dataset).
I have added a simplified dataset with data from two subjects during placebo and drug intervention nights.
Epoch= continuous measurements of sleep data are summarized into half minute periods
ID_= subject ID
Intervention_: placebo=2, drug=1
Stage: sleep stages; 0= wake, 1= NREM sleep, 2= REM sleep.
With the three sleep conditions (one is actually wake) there are six possible transitions which I would like to compare between placebo and drug intervention nights;
0 to 1, 0 to 2, 1 to 0, 1 to 2, 2 to 0, 2 to 1
I really appreciate if someone could help me!
Thank you!
Harald
Dataset:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input double Epoch long(ID_ intervention_) double Stage 1 1 2 0 2 1 2 1 3 1 2 2 4 1 2 0 1 2 2 0 2 2 2 1 3 2 2 2 4 2 2 1 5 2 2 1 1 1 1 0 2 1 1 1 3 1 1 0 4 1 1 2 5 1 1 0 1 2 1 0 2 2 1 1 3 2 1 2 4 2 1 0 5 2 1 1 6 2 1 0 end label values ID_ ID_ label def ID_ 1 "ID1", modify label def ID_ 2 "ID2", modify label values intervention_ intervention_ label def intervention_ 1 "n", modify label def intervention_ 2 "p", modify label values Stage NREM label def NREM 0 "Våken", modify label def NREM 1 "NREM", modify label def NREM 2 "REM", modify
0 Response to How to do an analysis of transition frequencies in a placebo controlled study?
Post a Comment