Learn R Programming

SPCompute

The goal of SPCompute is to compute power and sample size for replication GWAS study, while accommodates different kinds of covariate effects. The methodology used in the software is described in this paper by Ziang Zhang and Lei Sun. The detailed implementation guideline can be found in the vignette of this package.

Installation

You can install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("AgueroZZ/SPCompute")

Example

This is a basic example which shows you how to solve a common problem of computing power for genetic association testing with a binary trait:

library(SPCompute)
## basic example code
parameters <- list(preva = 0.2, pG = 0.3, pE = 0.3, gammaG = 0.1, betaG = 0.1, betaE = 0.3)
Compute_Power(parameters, n = 8000, response = "binary", covariate = "none")
#> [1] 0.6404552

Copy Link

Version

Install

install.packages('SPCompute')

Monthly Downloads

229

Version

1.0.3

License

GPL (>= 3)

Maintainer

Ziang Zhang

Last Published

January 24th, 2023

Functions in SPCompute (1.0.3)

check_parameters

Check if the parameter list contains all the parameters required for the computation.
Compute_Size_multi

Compute the sample size of an association study to achieve a target power for multiple E's, using semi-sim.
Compute_Size

Compute the sample size of an association study, to achieve a target power.
Compute_Power

Compute the Power of an association study, at a given sample size.
Compute_Power_multi

Compute the Power of an association study at a given sample size, accommodating more than one covariates, using the Semi-Simulation method.
convert_preva_to_intercept

Convert the prevalence value to the intercept value beta0.