lmCSmat: Cosinor

View source: R/stats.R

lmCSmatR Documentation

Cosinor

Description

Fixed period cosinor ("harmonic regression") on each row of a matrix

Usage

lmCSmat(x, zts, per = 24)

Arguments

x

- numeric data matrix

zts

- numeric vector of length ncol(data) representing time points for each data column

per

- period of oscillations (default=24)

Details

Fits a cosinor model to each row of a matrix.

Value

data frame with the following estimated statistics:

  • acrophase - acrophases

  • amplitude - amplitudes

  • Rsq - r-squared values

  • pvalue - p-values

  • mesor - intercept coefficient

  • sincoef - sine coefficient

  • coscoef - cosine coefficient

Author(s)

Karolis Koncevičius

Examples

## Not run: 
tmpData <- matrix(rnorm(24 * 1000), ncol = 24)
tmpData[sample(length(tmpData), nrow(tmpData))] <- NA
lmCSmat(tmpData, 1:24, 24)

## End(Not run)

matthewcarlucci/DiscoRhythm documentation built on March 24, 2022, 10:22 a.m.