View source: R/rep_rhythmicity.R
rpt_rhythmicity | R Documentation |
Likelihood-based test for circadian pattern detection with repeated measurement.
rpt_rhythmicity(tt, yy, id, period = 24, method = "LR")
tt |
Time vector. |
yy |
Expression vector. |
id |
Subject ID numbers. |
period |
Period of the since curve. Default is 24. |
method |
Testing methods can be "LR" or "F". Default is "LR". |
Test the significance of circadian curve fitting using mixed model with random intercept and likelihood-based test.
A list of test statistic and pvalue. Formula 1: yy = amp * sin(2π/period * (phase + tt)) + offset Formula 2: yy = A * sin(2π/period * tt) + B * cos(2*π/period * tt) + offset
stat |
Test statistic. |
pvalue |
P-value from the test. |
A |
Amplitude estimate. |
phi |
Phase estimate. |
basal |
Basal level estimate. |
sigma_0 |
Standard deviation for the fixed part of intercept. |
sigma_alpha |
Standard deviation for the random part of intercept. |
Haocheng Ding, Zhiguang Huo
Example 1 set.seed(32611) m <- 10 n <- 12 id <- rep(1:n,each=m) rho <- 0.2 offset <- runif(1,0,3) sigmaMat <- ifelse(diag(m)==1,1,rho) tt <- rep(runif(m,0,24),n) yy <- as.vector(t(mvrnorm(n,rep(offset,m),sigmaMat))) rpt_rhythmicity(tt, yy, id, period=24, method="LR") Example 2 set.seed(32611) m <- 10 n <- 12 id <- rep(1:n,each=m) rho <- 0.2 amp <- 1 phase <- 3 offset <- runif(1,0,3) sigmaMat <- ifelse(diag(m)==1,1,rho) t <- runif(m,0,24) tt <- rep(t,n) yy <- as.vector(t(mvrnorm(n,amp*sin(2*pi/24*(phase+t))+offset,sigmaMat))) rpt_rhythmicity(tt, yy, id, period=24, method="LR")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.