pcr_lm: Linear regression qPCR data

Description Usage Arguments Value Examples

View source: R/testing_fun.R

Description

Linear regression qPCR data

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
pcr_lm(
  df,
  group_var,
  reference_gene,
  reference_group,
  model_matrix = NULL,
  mode = "subtract",
  tidy = TRUE,
  ...
)

Arguments

df

A data.frame of C_T values with genes in the columns and samples in rows rows

group_var

A character vector of a grouping variable. The length of this variable should equal the number of rows of df

reference_gene

A character string of the column name of a control gene

reference_group

A character string of the control group in group_var

model_matrix

A model matrix for advanced experimental design. for constructing such a matrix with different variables check model.matrix

mode

A character string for the normalization mode. Possible values are "subtract" (default) or "divide".

tidy

A logical whether to return a list of lm or a tidy data.frame. Default TRUE.

...

Other arguments to lm

Value

A data.frame of 6 columns

When tidy is FALSE, returns a list of lm objects.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# locate and read data
fl <- system.file('extdata', 'ct4.csv', package = 'pcr')
ct4 <- read.csv(fl)

# make group variable
group <- rep(c('control', 'treatment'), each = 12)

# test
pcr_lm(ct4,
       group_var = group,
       reference_gene = 'ref',
       reference_group = 'control')

# testing using lm method
pcr_test(ct4,
         group_var = group,
         reference_gene = 'ref',
         reference_group = 'control',
         test = 'lm')

pcr documentation built on April 1, 2020, 9:07 a.m.