test_reg_corr_mixed: Logistic regression with random effects and given correlation...

Description Usage Arguments Value Examples

View source: R/test_reg_corr_mixed.R

Description

Get p.value and beta coefficient from grouping variable from logistic regression with random effects and given correlation matrix based on number of methylated and unmethylated citozines in two probes. This function doesn't respect tiles or tiles.common column. This function is using in find.DMR and can be used separately.

Usage

1

Arguments

data

There are two options: 1. dataframe with specific columns: chr, poz, prob, no, meth, unmeth, meth.rate. This dataframe is result of function preprocessing. 2. dataframe with specific columns: chr, poz, prob, no, meth, unmeth, meth.rate, tiles and possible tiles.common columns. This dataframe is result of function create.tiles.min.gap or create.tiles.fixed.length.

Value

vector with p.value and beta coef. from grouping variable from logistic regression with random effects and given correlation matrix or two-elemented vector of na values if something goes wrong

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
data('schizophrenia')
control <- schizophrenia %>% filter(category == 'control') %>%
dplyr::select(-category)

disease <- schizophrenia %>% filter(category == 'disease') %>%
 dplyr::select(-category)

data <- preprocessing(control, disease)
data.tiles <- create_tiles_max_gap(data, gaps.length = 100)

# we must also read acf vector which was previously estimated
data('mean.acf.chr')
acf <- mean.acf.chr[-1]
data.test <- data.tiles %>% filter(tiles == 10)
test_reg_corr_mixed(data.test, acf)
# or by some self-defined regions:
data.test.2 <- data.tiles %>% filter(chr == 'chr1', poz > 80000, poz < 82000)
test_reg_corr_mixed(data.test.2, acf)

geneticsMiNIng/metR documentation built on May 28, 2019, 8:41 p.m.