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

Example output

Loading required package: cosinor
     MESOR Amplitude Acrophase
1 1.425857 0.0974052  -1.72258
     MESOR  Amplitude Acrophase
1 1.433233 0.06075725 -4.960697
     MESOR Amplitude Acrophase
1 1.433198   0.19714 -1.850201
     MESOR Amplitude Acrophase
1 1.427776  0.304104 -1.912313
     MESOR Amplitude Acrophase
1 1.435419 0.2662682 -5.544496
    MESOR  Amplitude Acrophase
1 1.43029 0.06176998 -2.718438
     MESOR  Amplitude Acrophase
1 1.434468 0.04256186 -5.541007
     MESOR  Amplitude Acrophase
1 1.424263 0.08404731 -3.533264
     MESOR  Amplitude Acrophase
1 1.411967 0.09632206 -2.337104
     MESOR  Amplitude Acrophase
1 1.412025 0.08017202 -1.386624
     MESOR  Amplitude  Acrophase
1 1.417406 0.06764207 -0.9277698
     MESOR  Amplitude Acrophase
1 1.423402 0.07285646 -0.797064
     MESOR  Amplitude  Acrophase
1 1.429137 0.09019328 -0.4762216
     MESOR Amplitude   Acrophase
1 1.435329 0.1086437 -0.02046403
     MESOR Amplitude Acrophase
1 1.442338 0.1267374 -5.837713
    MESOR Amplitude Acrophase
1 1.44912 0.1419786 -5.401883
     MESOR Amplitude Acrophase
1 1.454175 0.1526687  -4.99271
     MESOR Amplitude Acrophase
1 1.456779 0.1603039 -4.599086
     MESOR Amplitude Acrophase
1 1.457111 0.1680407 -4.219345
     MESOR Amplitude Acrophase
1 1.455731 0.1781909 -3.862963
     MESOR Amplitude Acrophase
1 1.453189 0.1910275 -3.542146
     MESOR Amplitude Acrophase
1 1.449895 0.2052233 -3.263165
     MESOR Amplitude Acrophase
1 1.446123 0.2190292 -3.024845
    MESOR Amplitude Acrophase
1 1.44204 0.2311564 -2.821844
     MESOR Amplitude Acrophase
1 1.437745 0.2410379 -2.647864
     MESOR Amplitude Acrophase
1 1.433291 0.2486865 -2.497237
     MESOR Amplitude Acrophase
1 1.428704 0.2544403 -2.365372
     MESOR Amplitude Acrophase
1 1.423996 0.2587514 -2.248695
[1] "The best fitting period is 6."
There were 21 warnings (use warnings() to see them)
[1] "The best fitting period is 23."
Warning messages:
1: Removed 25 rows containing missing values (geom_point). 
2: Removed 25 rows containing missing values (geom_point). 
3: Removed 2 rows containing missing values (geom_path). 

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