f.test: To get the F-statistics for each gene

Description Usage Arguments Value Author(s) Examples

View source: R/f.test.R

Description

Calculate the F-statistics measuring the differential expression of each gene

Usage

1

Arguments

data

A vector containing the expression values of a gene across two datasets

type

A vector indicating the type of each sample (coming from dataset 1 or dataset 2)

Value

The F-statistics of a specific gene

Author(s)

Haisu Ma

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
#Load the simulated datasets

data(simulated_data)
data1 <- simulated_data[[1]]
data2 <- simulated_data[[7]]

#Calculate the F-statistics for genes 1~10

num_sample <- dim(data1)[1]
diff_expr <- rep(0,10)
type <- c(rep(0,num_sample),rep(1,num_sample))

for(i in 1:10){
       data <- c(data1[,i],data2[,i])
       diff_expr[i] <- f.test(data,type)
    }

COSINE documentation built on May 1, 2019, 10:21 p.m.