cosinor.poptests: Comparison of Cosinor Parameters of Two Populations

Description Usage Arguments Details Note References Examples

View source: R/cosinor2.R


Runs the tests that compare MESORs, amplitudes and acrophases of two different populations.


cosinor.poptests(pop1, pop2)



An object of the population.cosinor.lm class calculated on the first population.


An object of the population.cosinor.lm class calculated on the second population.


Bingham et al. (1982) describe tests for comparing population MESORs, amplitudes and acrophases. These tests are esentially F-ratios with df_1 = m - 1 and df_2 = K - m, where m is the number of populations and K is the total number of subjects. The tests for MESOR, amplitude and acrophase differences respectively are calculated as follows:

F_M = \frac{∑_{j = 1}^{m}k_j(\widehat{M}_j - \widehat{M})^2}{(m-1)\widehat{σ}_M^2}

F_φ = \frac{\frac{∑_{j = 1}^{m}k_j A_j^2 * sin^2(\widehat{φ}_j - \tilde{φ})}{m - 1}} {\widehat{σ}_β^2 sin^2\tilde{φ} + 2\widehat{σ}_{β γ} cos\tilde{φ}sin\tilde{φ} + \widehat{σ}_γ^2 cos^2\tilde{φ}}

F_A = \frac{\frac{∑_{j = 1}^{m}(\widehat{A}_j - \widehat{A})^2}{m - 1}}{\widehat{σ}^2_β cos^2\widehat{φ} - 2\widehat{σ}_{β γ}cos\widehat{φ}sin\widehat{φ} + \widehat{σ}^2_γ sin^2 \widehat{φ}}

where \widehat{M}, \widehat{A} and \widehat{φ} are weighted averages of parameters across populations calculated as:

\widehat{M} = \frac{∑_{j = 1}^{m}k_j\widehat{M}_j}{K}

\widehat{A} = \frac{∑_{j = 1}^{m}k_j\widehat{A}_j}{K}

\widehat{φ} = \frac{∑_{j = 1}^{m}k_j\widehat{φ}_j}{K}

\tilde{φ} is derived from the following expression:

tan 2\tilde{φ} = \frac{∑_{j = 1}^{m}k_j\widehat{A}^2_j sin 2\widehat{φ}_j}{∑_{j = 1}^{m}k_j\widehat{A}^2_j cos 2\widehat{φ}_j}

where 2\tilde{φ} lies between -\frac{π}{2} and \frac{π}{2} if the denomanator is positive or between \frac{π}{2} and \frac{3π}{2} if the denominator is negative, k_j is the number of subjects in the jth population, \widehat{M}_j, \widehat{A}_j and \widehat{φ}_j are the cosinor parameters of the jth population and \widehat{σ}_β,\widehat{σ}_γ and \widehat{σ}_{β γ} are the estimates of pooled standard deviations (and covariance) calculated as following:

\widehat{σ}_β = \frac{∑_{j = 1}^{m} (k_j - 1)\widehat{σ}_{β_j}}{K - m}

\widehat{σ}_γ = \frac{∑_{j = 1}^{m} (k_j - 1)\widehat{σ}_{γ_j}}{K - m}

\widehat{σ}_{β γ} = \frac{∑_{j = 1}^{m} (k_j - 1)\widehat{σ}_{{β_j} {γ_j}}}{K - m}

where \widehat{σ}_{β_j}, \widehat{σ}_{γ_j} and \widehat{σ}_{{β_j} {γ_j}} are the standard devations and covariance of β and γ parameters in the jth population.


These tests should only be performed on independent samples. If the acrophases of two populations are significantly different, the results of the amplitude difference test are not reliable and should not be interpreted. While it's possible to perform tests which compare more than two populations, this function can only compare two populations.


Bingham, C., Arbogast, B., Guillaume Corn<c3><a9>lissen, G., Lee, J.K. & Halberg, F. (1982). Inferential Statistical Methods for Estimating and Comparing Cosinor Parameters. Chronobiologia, 9(4), 397-439.


fit.extraverts<-population.cosinor.lm(data = PA_extraverts, time = PA_time,
period = 24)
fit.introverts<-population.cosinor.lm(data = PA_introverts, time = PA_time,
period = 24)
cosinor.poptests(pop1 = fit.extraverts, pop2 = fit.introverts)

Example output

Loading required package: cosinor
     MESOR Amplitude Acrophase
1 3.053484  0.290861 -4.144953
     MESOR Amplitude Acrophase
1 2.917414 0.2190473 -5.058308
                   F df1 df2         p 1st population 2nd population
MESOR     0.32644795   1  51 0.5702677       3.053484      2.9174142
Amplitude 0.01669058   1  51 0.8977139       0.290861      0.2190473
Acrophase 2.25074729   1  51 0.1397157      -4.144953     -5.0583083

cosinor2 documentation built on May 1, 2019, 10:25 p.m.