where Ti is the number of seconds spent in stage i, Wi is the weighting coefficient of the respective stage, n is the number of stages of sleep, T is the total number of seconds spent in all stages of sleep and Ns is the total number of sleep stage shifts. The weighting coefficient was introduced in order to accentuate the difference in sleep quality between OSA and normal subjects. The number of seconds spent in each sleep stage was then multiplied by its respective weighting coefficient. The time spent in each sleep stage was then summed to obtain a total number of seconds the subject was in bed. The number of sleep stage shifts was also calculated. The Sleep Index was calculated using Eq. (1). Since the number of sleep stage shifts is placed in the denominator, the number of sleep stage shifts needs to be small for the Sleep Index to be higher, and hence be qualified as a good night’s sleep [4].