LR_diff: Likelihood-based Tests for Detecting Differential Circadian...

View source: R/LR_diff.R

LR_diffR Documentation

Likelihood-based Tests for Detecting Differential Circadian Pattern

Description

Likelihood-based tests for differential circadian pattern detection.

Usage

LR_diff(
  tt1,
  yy1,
  tt2,
  yy2,
  period = 24,
  method = "LR",
  FN = TRUE,
  type = "all"
)

Arguments

tt1

Time vector of condition 1.

yy1

Expression vector of condition 1.

tt2

Time vector of condition 2.

yy2

Expression vector of condition 2.

period

Period of the since curve. Default is 24.

method

Test used to detect differential circadian pattern. It can be chosen either "LR" or "Wald". Default is LR.

FN

"TRUE" if using finite sample likelihood-based tests and "FALSE" if using general large sample likelihood-based tests. Default is "TRUE".

type

Test differential circadian pattern in differential "amplitude", "phase", "basal", "fit" or "all". Default is "all".

Details

Test differential amplitude/phase/basal level/rhythmicity of circadian curve fitting using likelihood-based tests.

Value

A list, see details below. Formula 1: yy = amp * sin(2π/period * (phase + tt)) + offset. Formula 2: yy = A * sin(2π/period * tt) + B * cos(2*π/period * tt) + offset.

amp_1

Amplitude estimate of the 1st data.

amp_2

Amplitude estimate of the 2nd data.

amp_c

Amplitude estimate pooling all data together.

phase_1

Phase estimate of the 1st data, phase is restricted in (0, period).

phase_2

Phase estimate of the 2nd data, phase is restricted in (0, period).

phase_c

Phase estimate pooling all data together, phase is restricted in (0, period).

offset_1

Basal level estimate of the 1st data.

offset_2

Basal level estimate of the 2nd data.

offset_c

Basal level estimate pooling all data together.

sigma2_1

Variance estimate of the 1st data.

sigma2_2

Variance estimate of the 2nd data.

sigma2_C

Variance estimate pooling all data together.

l0

Log likelihood under the null (same variance between the two groups).

l1

Log likelihood under the alternative (different variance between the two groups).

stat

Test statistic.

pvalue

P-value from the test.

Author(s)

Zhiguang Huo, Haocheng Ding

Examples

set.seed(32608)
n <- 50
tt1 <- runif(n,0,24) 
Amp1 <- 2
Phase1 <- 6
Offset1 <- 3
yy1 <- Amp1 * sin(2*pi/24 * (tt1 + Phase1)) + Offset1 + rnorm(n,0,1)
tt2 <- runif(n,0,24) 
Amp2 <- 3
Phase2 <- 5
Offset2 <- 2
yy2 <- Amp2 * sin(2*pi/24 * (tt2 + Phase2)) + Offset2 + rnorm(n,0,1)
LR_diff(tt1, yy1, tt2, yy2)

diffCircadian/diffCircadian documentation built on Feb. 24, 2023, 9:07 a.m.