regression: Linear or logistic regression

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Run linear or logistic regression on variants

Usage

1
2
3
4
## S4 method for signature 'SeqVarData'
regression(gdsobj, outcome, covar=NULL,
    model.type=c("linear", "logistic", "firth"),
    parallel=FALSE)

Arguments

gdsobj

A SeqVarData object

outcome

A character string with the name of the column in sampleData(gdsobj) containing the outcome variable

covar

A character vector with the name of the column(s) in sampleData(gdsobj) containing the covariates

model.type

the type of model to be run. "linear" uses lm, "logistic" uses glm with family=binomial(), and "firth" uses logistf.

parallel

Logical, numeric, or other value to control parallel processing; see seqParallel for details.

Details

regression tests the additive effect of the reference allele.

Value

a data.frame with the following columns (if applicable):

variant.id

variant identifier

n

number of samples with non-missing data

n0

number of controls (outcome=0) with non-missing data

n1

number of cases (outcome=1) with non-missing data

freq

reference allele frequency

freq0

reference allele frequency in controls

freq1

reference allele frequency in cases

Est

beta estimate for genotype

SE

standard error of beta estimate for the genotype

Wald.Stat

chi-squared test statistic for association

Wald.pval

p-value for association

PPL.Stat

firth only: profile penalized likelihood test statistic for association

PPL.pval

firth only: p-value for association

Author(s)

Stephanie Gogarten

See Also

SeqVarData, seqSetFilter, lm, glm, logistf

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
gds <- seqOpen(seqExampleFileName("gds"))

## create some phenotype data
library(Biobase)
sample.id <- seqGetData(gds, "sample.id")
n <- length(sample.id)
df <- data.frame(sample.id,
   sex=sample(c("M", "F"), n, replace=TRUE),
   age=sample(18:70, n, replace=TRUE),
   phen=rnorm(n),
   stringsAsFactors=FALSE)
meta <- data.frame(labelDescription=c("sample identifier",
   "sex", "age", "phenotype"), row.names=names(df))
sample.data <- AnnotatedDataFrame(df, meta)
seqData <- SeqVarData(gds, sample.data)

## select samples and variants
seqSetFilter(gds, sample.id=sample.id[1:50], variant.id=1:10)

res <- regression(seqData, outcome="phen", covar=c("sex", "age"))
res
seqClose(gds)

SeqVarTools documentation built on Nov. 22, 2020, 2 a.m.