periodogram: Periodogram

Description Usage Arguments Details Note References See Also Examples

View source: R/cosinor2.R

Description

Estimates the best-fitting period using iterative cosinor procedure.

Usage

1
2
periodogram(data, time, periods = time, na.action = na.omit,
  alpha = 0.05)

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. If this vector includes midnight, it should be coded as 24 instead of 0.

periods

A vector containing periods that are to be included in the periodogram. Defaults to the same periods as provided in the vector time.

na.action

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

alpha

Significance level for determining if a rhythm with a given period is significant or not. Defaults to .05.

Details

Iterative cosinor procedure is performed as described in Klemfuss & Clopton (1993). Cosinor is performed iteratively with the period (τ) increased by 1 in each iteration. Percent Rhythm is calculated in each iteration, which allows for an estimation of the best fitting period. A periodogram can be plotted, which shows Percent Rhythm (coefficient of determination) for each period. On the plot, periods with significant rhythm are shown as a point and periods with insignificant rhythm are shown as a cross.

Note

The range of periods included in iterations starts from 3 (sinusoidality of the curve is not achieved for τ < 3) and ends with the number of timepoints in the data.

References

Klemfuss, H. & Clopton, P. L. (1993). Seeking Tau: A Comparison of Six Methods. Journal of Interdisciplinary Cycle Research, 24(1), 1-16.

See Also

cosinor.PR

Examples

1
2
3

amutak/cosinor2 documentation built on May 22, 2019, 2:16 p.m.