Performs score test using saddlepoint approximation to estimate the null distribution.
ScoreTest_SPA(genos,pheno,cov,obj.null,method=c("fastSPA","SPA"),minmac=5,
Cutoff=2,alpha=5*10^-8,missing.id=NA,beta.out=FALSE,beta.Cutoff=5*10^-7,log.p=FALSE)A vector or matrix containing the genotypes or dosages. If matrix is provided then rows should correspond to SNPs and columns should correspond to subjects. Optional, but needed if obj.null is missing.
A vector containing the outcomes (phenotypes). Optional, but needed if obj.null is missing.
A matrix or data frame containing the covariates. Optional, but needed if obj.null is missing.
An object of class "SA_NULL". (Optional)
String specifying the p-value calculation method. Possible values are "fastSPA" (default) and "SPA".
Minimum minor allele count threshold to run SPA test, default value is \(5\).
An integer or the string "BE" denoting the standard deviation cutoff to be used. If Cutoff = "BE", the level-specific cutoff based on Berry-Esseen theorem is calculated. If the test statistic lies within the standard deviation cutoff of the mean, p-value based on traditional score test is returned. Default value is 2.
Significance level for the test(s), default value is \(5\times 10^{-8}\). Used only if Cutoff = "BE".
Missing value indicator. Numeric or NA, default value is NA.
Logical indicating whether log odds ratios (beta parameters) are to be estimated, default value is FALSE.
Maximum p-value threshold for beta parameters to be estimated, default value is \(5\times 10^{-7}\).
Whether to return natural log-transformed p-values, default value is FALSE. NOTE: log-transformed p-values are not compatible with Meta-analysis using this package.
p-value or natural log-transformed p-value based on the saddlepoint approximation.
p-value or natural log-transformed p-value based on the normal approximation (traditional score test).
"TRUE" or "FALSE" denoting whether the root-finding algorithm for the saddlepoint equation has converged.
Genotype log-odds ratio estimate.
Standard error for the genotype log-odds ratio.
genos can have discrete 0, 1, 2 values or continuous values between [0,2]. The genotype or dosage values can represent any of the major allele, minor allele, reference allele or alternate allele counts (or dosages), as long as it is consistent throughout the subjects.
genos can have missing values denoted by the missing.id argument. Such missing values will be imputed using mean imputation. pheno or cov cannot have missing values.
pheno and cov are ignored if obj.null is provided. If both obj.null and cov is missing, or obj.null is missing and cov=NULL, then the vector rep(1,n) is assigned to cov, where n is the number of subjects.
method = "SPA" is the basic saddlepoint approximation based test without the partially normal approximation improvement.
method = "fastSPA" utilizes the partially normal approximation approach for improved efficiency, especially for rare variants.
Beta parameters are estimated using Firth's method, and thus computationally expensive. Therefore, it is recommended that beta parameters are only to be estimated when the p-value is very small (denoted by beta.Cutoff). The code for beta estimation is as implemented by Clement Ma in the EPACTS software.
Dey, R. et al., 2017. A Fast and Accurate Algorithm to Test for Binary Phenotypes and Its Application to PheWAS. The American Journal of Human Genetics, Vol 101 (1), 37-49.
Ma, C. et al., 2013. Recommended Joint and Meta-Analysis Strategies for Case-Control Association Testing of Single Low-Count Variants. Genetic Epidemiology, Vol 37 (6), 539-550.
# NOT RUN {
ScoreTest_SPA(genos,pheno,cov,obj.null,method=c("fastSPA","SPA"),
minmac=5,Cutoff=2,alpha=5*10^-8,missing.id=NA,beta.out=FALSE,beta.Cutoff=5*10^-7,log.p=FALSE)
# }
Run the code above in your browser using DataLab