cosinor: Cosinor

cosinorR Documentation

Cosinor

Description

Performs a Cosinor test for periodicity on each row/column of the input matrix.

Usage

row_cosinor(x, t, period = 24)

col_cosinor(x, t, period = 24)

Arguments

x

numeric matrix.

t

a vector specifying time variable for each observation of x.

period

oscillation period in the units of t (default = 24, suitable when inspecting diurnal rhythms with hourly data).

Details

row_cosinor - cosinor test on rows. col_cosinor - cosinor test on columns.

Value

a data.frame where each row contains the results of a cosinor test performed on the corresponding row/column of x.

Each row contains the following information (in order):
1. obs - total number of observations
2. mesor - "Midline Estimating Statistic Of Rhythm" - the average value around which the variable oscillates
3. amplitude - difference between mesor and the peak of the rhythm
4. acrophase - time when rhythm reaches its peak
5. rsquared - R-squared
6. df.model - model terms degrees of freedom
7. df.residual - residual degrees of freedom
8. statistic - F statistic for the omnibus test against intercept-only model
9. pvalue - p-value
10. period - the period used within the model

Author(s)

Karolis Koncevičius

See Also

cosinor.lm

Examples

wave <- sin(2*pi*1:24/24) + rnorm(24)
row_cosinor(wave, 1:24, 24)


matrixTests documentation built on Oct. 6, 2023, 1:07 a.m.