Learn R Programming

cosinor2 (version 0.2.1)

population.cosinor.lm: Population-Mean Cosinor

Description

Calculates the population-mean cosinor.

Usage

population.cosinor.lm(data, time, period, na.action = na.omit,
  alpha = 0.05, plot = T)

Arguments

data

A data frame containing responses of subjects collected over time, with subjects in the rows and timepoints in the columns.

time

A vector containing the times at which the data was collected.

period

Duration of one cycle of rhythm.

na.action

Action to be performed on missing values. Defaults to na.omit.

alpha

Significance level for calculating population cosinor parameters confidence intervals. Defaults to .05 (confidence intervals are 5% risk intervals).

plot

Logical, display plot after calculation? Defaults to TRUE.

Value

Object of the population.cosinor.lm class containing the following objects:

single.cos

A list of objects containing all performed single cosinors.

pop.mat

A data frame containing the cosinor parameters of each subject in the population.

coefficients

Delinearized population-mean cosinor coefficients.

emp.mean

Empirical mean of the data across all timepoints.

fitted.values

Estimated values of the rhythm caclculated using the cosinor model.

residuals

The difference between empirical mean and the fitted values.

conf.int

Values of upper and lower limits of confidence intervals of delinearized cosinor parameters.

Details

According to the procedure described in Corn<U+00E9>lissen (2014), to calculate population-mean cosinor, single cosinors are first performed on each subject and linearized parameters are averaged, which allows for calculation of delinearized parameters. After such a procedure is completed, confidence intervals of population-mean cosinor parameters can be calculated as described in Bingham et al. (1982) using the following formulae: $$\widehat{M} \pm \frac{t_{1-\frac{\alpha}{2}}\widehat{\sigma}_M}{\sqrt{k}}$$ $$\widehat{\phi}+arctan(\frac{c_{23} t_{1-\frac{\alpha}{2}}^2 \pm t_{1-\frac{\alpha}{2}}\sqrt{c_{33}} \sqrt{\widehat{A}^2-\frac{(c_{22}c_{33}-c_{23}^2)t_{1-\frac{\alpha}{2}}^2}{c_{33}}}}{\widehat{A}^2 - c_{22} t_{1-\frac{\alpha}{2}}^2})$$ $$\widehat{A} \pm t_{1-\frac{\alpha}{2}} \sqrt{c_{22}}$$ where \(c_{22}\), \(c_{23}\) and \(c_{33}\) are elements of the sampling scheme matrix, calculated as follows: $$c_{22}=\frac{\widehat{\sigma}^2_{\beta}\widehat{\beta}^2+2\widehat{\sigma}_{\beta \gamma}\widehat{\beta}\widehat{\gamma}+\widehat{\sigma}^2_{\gamma}\widehat{\gamma}^2}{k\widehat{A}^2}$$ $$c_{23}=\frac{-(\widehat{\sigma}^2_{\beta}-\widehat{\sigma}^2_{\gamma})(\widehat{\beta}\widehat{\gamma})+\widehat{\sigma}_{\beta \gamma}(\widehat{\beta}^2-\widehat{\gamma}^2)}{k\widehat{A}^2}$$ $$c_{33}=\frac{\widehat{\sigma}^2_{\beta}\widehat{\gamma}^2-2\widehat{\sigma}_{\beta \gamma}\widehat{\beta}\widehat{\gamma}+\widehat{\sigma}^2_{\gamma}\widehat{\beta}^2}{k\widehat{A}^2}$$ where \(\widehat{M}\), \(\widehat{A}\), \(\widehat{\phi}\), \(\widehat{\beta}\) and \(\widehat{\gamma}\) are population-mean cosinor parameters, \(\widehat{\sigma}_M\), \(\widehat{\sigma}_{\beta}\) and \(\widehat{\sigma}_{\gamma}\) are the standard deviations of the single cosinor parameters, \(\widehat{\sigma}_{\beta \gamma}\) is the covariance of the single cosinor \(\beta\) and \(\gamma\) coefficients, \(k\) is the number of subjects in a population and \(t_{1-\frac{\alpha}{2}}\) is the two-tailed inverse of the t-distribution with \(\alpha\) level of significance and \(k - 1\) degrees of freedom.

References

Corn<U+00E9>lissen, G. (2014). Cosinor-Based Rhythmometry. Theoretical Biology and Medical Modeling, 11, Article 16.

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

Examples

Run this code
# NOT RUN {
population.cosinor.lm(data = PANAS_november, time = PANAS_time,
period = 7, na.action = "na.exclude")
# }

Run the code above in your browser using DataLab