Description Usage Arguments Details Value Methods (by class) See Also Examples
View source: R/driver_compute_spre_statistics.R
getspres
computes SPRE (standardised predicted random-effects)
statistics to identify outlier studies in genetic association meta-analyses
which might have undue influence on the average genetic effect leading to
inflated genetic signals.
1 2 3 4 5 6 7 8 9 10 11 12 |
beta_in |
A numeric vector of study effect-sizes e.g. log odds-ratios. |
se_in |
A numeric vector of standard errors, genomically corrected at study-level. |
study_names_in |
A character vector of study names. |
variant_names_in |
A character vector of variant names e.g. rsIDs. |
... |
other arguments. |
tau2_method |
A character scalar, specifying the method that should be used to estimate heterogeneity either through DerSimonian and Laird's moment-based estimate "DL" or restricted maximum likelihood "REML". Note: The REML method uses the iterative Fisher scoring algorithm (step length = 0.5, maximum iterations = 10000) to estimate tau2. Default is "DL". |
verbose_output |
An optional boolean to display intermediate output. (Default is |
SPRE statistics are precision-weighted residuals that summarise the direction and extent with which observed study effects in a meta-analysis differ from the summary (or average genetic) effect. See the getspres website for more information, documentation and examples.
getspres
takes as input study effect-size estimates and their
corresponding standard errors (i.e. summary data). Study effect estimates
could be in the form of linear regression coefficients or log-transformed
regression coefficients (per-allele log odds ratios) from logistic
regression.
getspres
uses inverse-variance weighted meta-analysis models in the
metafor
R package to calculate SPRE statistics.
Returns a list containing:
number_variants A numeric scalar for the number of variants
number_studies A numeric scalar for the number of studies
spre_dataset A dataframe that is a dataset of computed SPRE statistics and contains the following fields:
beta , study effect-size estimates
se , corresponding standard errors of the study effect-size estimates
variant_names , variant names
study_names , study names
study , study numbers
snp , snp numbers
tau2 , tau_squared, estimate of amount of between-study variance
I2 , I_squared, heterogeneity index (Higgins inconsistency metric) representing proportion of total observed variation due to between-study variance
Q , Q-statistic (Cochran's Q)
xb , prediction excluding random effects
xbse , standard error of prediction excluding random effects
xbu , predictions including random effects
stdxbu , standard error of prediction (fitted values) including random effects
hat , leverage a.k.a diagonal elements of the projection hat matrix
rawresid , raw residuals
uncondse , unconditional standard errors
spre , SPRE statistics (standardised predicted random effects) i.e. raw residuals divided by the unconditional standard errors
default
: Computes SPRE statistics in genetic association meta-analyses
https://magosil86.github.io/getspres/ to the visit getspres
website.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | library(getspres)
# Calculate SPRE statistics for a subset of variants in the heartgenes214 dataset.
# heartgenes214 is a case-control GWAS meta-analysis of coronary artery disease.
# To learn more about the heartgenes214 dataset ?heartgenes214
# Calculating SPRE statistics for 3 variants in heartgenes214
heartgenes3 <- subset(heartgenes214,
variants %in% c("rs10139550", "rs10168194", "rs11191416"))
getspres_results <- getspres(beta_in = heartgenes3$beta_flipped,
se_in = heartgenes3$gcse,
study_names_in = heartgenes3$studies,
variant_names_in = heartgenes3$variants)
# Explore results generated by the getspres function
str(getspres_results)
# Retrieve number of studies and variants
getspres_results$number_variants
getspres_results$number_studies
# Retrieve SPRE dataset
df_spres <- getspres_results$spre_dataset
head(df_spres)
# Extract SPREs from SPRE dataset
head(spres <- df_spres[, "spre"])
# Exploring available options in the getspres function:
# 1. Estimate heterogeneity using "REML", default is "DL"
# 2. Calculate SPRE statistics verbosely
getspres_results <- getspres(beta_in = heartgenes3$beta_flipped,
se_in = heartgenes3$gcse,
study_names_in = heartgenes3$studies,
variant_names_in = heartgenes3$variants,
tau2_method = "REML",
verbose_output = TRUE)
str(getspres_results)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.