View source: R/run-pgs-statistics.R
run.pgs.regression | R Documentation |
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.
run.pgs.regression(pgs, phenotype.data)
pgs |
numeric vector of polygenic scores |
phenotype.data |
data.frame of phenotypes |
data frame with columns for phenotype, model, beta, se, p.value, r.squared, and AUC
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);
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.