Compute_Power {SPCompute}R Documentation

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

Description

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

Usage

Compute_Power(
  parameters,
  n,
  response = "binary",
  covariate = "binary",
  mode = "additive",
  alpha = 0.05,
  seed = 123,
  LargePowerApproxi = FALSE,
  searchSizeGamma0 = 100,
  searchSizeBeta0 = 100,
  B = 10000,
  method = "semi-sim"
)

Arguments

parameters

A list of parameters that contains all the required parameters in the model. If response is "binary", this list needs to contain "prev" which denotes the prevalence of the disease (or case to control ratio for case-control sampling). If response is continuous, the list needs to contain "traitSD" and "traitMean" which represent the standard deviation and mean of the continuous trait. If covariate is not "none", a parameter "gammaG" needs to be defined to capture the dependence between the SNP and the covariate (through linear regression model if covariate is continuous, and logistic model if covariate is binary). If covariate is "binary", list needs to contains "pE" that defines the frequency of the covariate. If it is continuous, list needs to contain "muE" and "sigmaE" to define its mean and standard deviation. The MAF is defined as "pG", with HWE assumed to hold.

n

An integer number that indicates the sample size.

response

A string of either "binary" or "continuous", indicating the type of response/trait variable in the model, by default is "binary"

covariate

A string of either "binary", "continuous" or "none" indicating the type of covariate E in the model, by default is "binary".

mode

A string of either "additive", "dominant" or "recessive", indicating the genetic mode, by default is "additive".

alpha

A numeric value that denotes the significance level used in the study, by default is 0.05.

seed

An integer number that indicates the seed used for the simulation to compute the approximate fisher information matrix, by default is 123.

LargePowerApproxi

TRUE or FALSE indicates whether to use the large power approximation formula.

searchSizeGamma0

The interval radius for the numerical search of gamma0, by default is 8. Setting to higher values may solve some numerical problems at the cost of longer runtime.

searchSizeBeta0

The interval radius for the numerical search of beta0, by default is 8. Setting to higher values may solve some numerical problems at the cost of longer runtime.

B

An integer number that indicates the number of simulated sample to approximate the fisher information matrix, by default is 10000 (Should only be changed if computation uses semi-simulation method).

method

An character that is either "semi-sim" (default) or "expand" using the idea of representative dataset. This specifies the method being used to compute the power/sample size when the trait is binary using logistic regression. The default method will be faster for large sample size computation.

Value

The power that can be achieved at the given sample size.

Examples

parameters <- list(TraitMean = 0.3, TraitSD = 1, pG = 0.2, betaG = log(1.1),
betaE = log(1.1), muE = 0, sigmaE = 3, gammaG = log(2.1))

Compute_Power(parameters, n = 1000, response = "continuous",
covariate = "continuous", method = "semi-sim")

[Package SPCompute version 1.0.3 Index]