cosinor.lm: Fit cosinor model

View source: R/cosinor.lm.R

cosinor.lmR Documentation

Fit cosinor model

Description

Given an outcome and time variable, fit the cosinor model with optional covariate effects.

Usage

cosinor.lm(formula, period = 12, data, na.action = na.omit)

Arguments

formula

Formula specifying the model. Indicate the time variable with time() and covariate effects on the amplitude and acrophase with amp.acro(). See details for more information.

period

Length of time for a complete period of the sine curve.

data

Data frame where variable can be found

na.action

What to do with missing data

Details

This defines special functions that are used in the formula to indicate the time variable and which covariates effect the amplitude. To indicate the time variable wrap the name of it in the function time(). To indicate a variable which affects the acrophase/amplitude, wrap the name in amp.acro(). This will then do all the transformations for you. See examples for usage.

References

Tong, YL. Parameter Estimation in Studying Circadian Rhythms, Biometrics (1976). 32(1):85–94.

Examples


cosinor.lm(Y ~ time(time) + X + amp.acro(X), data = vitamind)


cosinor documentation built on March 31, 2023, 11:39 p.m.