rowLogRegLRT {htSeqTools} | R Documentation

## Row-wise logistic regression

### Description

Row-wise logistic regressions are applied to a matrix with counts. For each row, an overall test comparing the column counts across columns is performed. Optionally, chi-square permutation tests are used when the expected counts are below 5 for some column.

### Usage

     rowLogRegLRT(counts, exact = TRUE, p.adjust.method = "none")

### Arguments

`counts` | Matrix with counts
`exact` | If set to TRUE, an exact test is used whenever some expected cell counts are 5 or less
`p.adjust.method` | p-value adjustment method, passed on to `p.adjust`

### Details

For each column, the proportion of counts in each row (with respect to the overall counts in that column) is computed. Then a statistical comparison of these proportions across groups is performed via a likelihood-ratio test (if `exact==TRUE` a permutation based chi-square test is used whenever the expected counts in some column is below 5).

Notice that data from column `j` can be viewed as a multinomial distribution with probabilities pj, where pj is a vector of length `nrow(x)`. `rowLogRegLRT` tests the null hypothesis p1[i]=...pc[i] for i=1...`nrow(x)`, where c is `ncol(x)`. This actually ignores the multinomial sampling model and focuses on its binomial margins, which is a reasonable approximation when the number `nrow(x)` is large and substantially improves computation speed.

### Examples

    #The first two rows present different counts across columns
    #The last two columns do not
    x <- matrix(c(70,10,10,10,35,35,10,10),ncol=2)
    x
    rowLogRegLRT(x)

[Package htSeqTools version 1.30.0 Index]