run.pgs.regression: Run linear and logistic regression on a polygenic score and a...

View source: R/run-pgs-statistics.R

run.pgs.regressionR Documentation

Run linear and logistic regression on a polygenic score and a set of phenotypes

Description

Phenotype data variables are automatically classified as continuous or binary and a simple linear regression or logistic regression, respectively, is run between the polygenic score and each phenotype. Categorical phenotypes with more than two category are ignored. If a binary variable is not formatted as a factor, it is converted to a factor using as.factor() defaults. For logistic regression, the first level is classified as "failure" and the second "success" by glm() defaults.

Usage

run.pgs.regression(pgs, phenotype.data)

Arguments

pgs

numeric vector of polygenic scores

phenotype.data

data.frame of phenotypes

Value

data frame with columns for phenotype, model, beta, se, p.value, r.squared, and AUC

Examples

set.seed(200);
pgs <- rnorm(200, 0, 1);
phenotype.data <- data.frame(
    continuous.pheno = rnorm(200, 1, 1),
    binary.pheno = sample(c(0, 1), 200, replace = TRUE)
    );
run.pgs.regression(pgs, phenotype.data);

ApplyPolygenicScore documentation built on April 4, 2025, 12:18 a.m.