Description Usage Arguments Value See Also Examples

View source: R/SPA_functions.R

Function to calculate the SPA p value from score function. Intended to be used by external libraries.

1 2 3 | ```
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)
``` |

`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 |

`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 |

1 2 3 4 5 | ```
## 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)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.