Saddle_Prob {SPAtest} | R Documentation |
Calculate Saddlepoint p values (for external libraries)
Description
Function to calculate the SPA p value from score function. Intended to be used by external libraries.
Usage
Saddle_Prob(q, mu, g, Cutoff=2,alpha,output="P",nodes.fixed,nodes.init,log.p=FALSE)
Saddle_Prob_fast(q, g,mu,gNA,gNB,muNA,muNB,Cutoff=2,alpha,output,nodes.fixed,
nodes.init,log.p=FALSE)
Arguments
q |
Numeric scalar, score statistic. |
mu |
Numeric vector, fitted probabilities from the null model. |
g |
Numeric vector, covariate adjusted genotypes. |
gNA |
Numeric vector, covariate adjusted genotypes where the observed genotype is zero. |
gNB |
Numeric vector, covariate adjusted genotypes where the observed genotype is non-zero. |
muNA |
Numeric vector, fitted probabilities from the null model where the observed genotype is zero. |
muNB |
Numeric vector, fitted probabilities from the null model where the observed genotype is non-zero. |
Cutoff |
An integer or the string "BE" denoting the standard deviation cutoff to be used. If |
alpha |
Significance level for the test(s), default value is |
output |
String specifying the output required. Possible values are " |
nodes.fixed |
Vector denoting the spline nodes for the spline based summary statistics, if you do not want to provide a fixed set of nodes instead of estimating the optimal set of nodes. Only applicable when the output is " |
nodes.init |
Vector denoting the initial values of the spline nodes when you want to estimate the optimal set of spline nodes using the coordinate descent algorithm. Only applicable when the output is " |
log.p |
Whether to return natural log-transformed p-values, default value is |
Value
p.value |
p-value or natural log-transformed p-value based on the saddlepoint approximation. If |
p.value.NA |
p-value or natural log-transformed p-value based on the normal approximation (traditional score test). If |
Is.converge |
"TRUE" or "FALSE" denoting whether the root-finding algorithm for the saddlepoint equation has converged. |
Score |
Centered score statistic. |
splfun |
Outputs from fitting the CGF-Spline method, if |
var |
Variance of the score test statistic, if |
See Also
Examples
## Not run:
Saddle_Prob(q, mu, g, Cutoff=2,alpha,output="P",nodes.fixed,nodes.init,log.p=FALSE)
Saddle_Prob_fast(q, g,mu,gNA,gNB,muNA,muNB,Cutoff=2,alpha,output,nodes.fixed,nodes.init,log.p=FALSE)
## End(Not run)