fampower: Simulation-based power calculation for genetic effect

View source: R/fampower.R

fampowerR Documentation

Simulation-based power calculation for genetic effect

Description

Computes the power of detecting genetic effect in the penetrance model based on a family-based simulation study.

Usage

fampower(N.fam, N.sim, effectsize, beta.sex, alpha = 0.05, side = 2, design = "pop", 
variation = "none", interaction = FALSE, depend = NULL, base.dist = "Weibull", 
frailty.dist = NULL, base.parms, allelefreq = c(0.02, 0.2), dominant.m = TRUE, 
dominant.s = TRUE, mrate = 0, hr = 0, probandage = c(45, 2), agemin = 20, agemax = 100)

Arguments

N.fam

Number of families to generate.

N.sim

Number of simulations.

effectsize

Effect size of the major mutated gene (beta.gene) to detect under the alternative hypothesis. When interaction=TRUE, both the main and interaction effects should be specified, effectsize = c(beta.gene, beta.int).

beta.sex

Gender effect that is fixed in the model.

alpha

Significance level. Default value is 0.05.

side

Number of sides for the alternative hypothesis. Possible choices are 1 for one-sided test and 2 for two-sided test. Default value is 2.

design

Family based study design used in the simulations. Possible choices are: "pop", "pop+", "cli", "cli+" or "twostage", where "pop" is for the population-based design that families are ascertained by affected probands, "pop+" is similar to "pop" but with mutation carrier probands, "cli" is for the clinic-based design that includes affected probands with at least one parent and one sibling affected, "cli+" is similar to "cli" but with mutation carrier probands and "twostage" for two-stage design that randomly samples families from the population in the first stage and oversamples high risk families in the second stage that includes at least two affected members in the family. Default is "pop".

variation

Source of residual familial correlation. Possible choices are: "frailty" for frailty shared within families, "secondgene" for second gene variation, or "none" for no residual familial correlation. Default is "none".

interaction

Logical; if TRUE, the interaction between gender and mutation status is allowed, otherwise no interaction is allowed. Default is FALSE.

depend

Variance of the frailty distribution. Dependence within families increases with depend value. Default value is NULL. Value > 0 should be specified when variation = "frailty".

base.dist

Choice of baseline hazard distribution. Possible choices are: "Weibull", "loglogistic", "Gompertz", "lognormal" "gamma", or "logBurr". Default is "Weibull".

frailty.dist

Choice of frailty distribution. Possible choices are: "gamma" for gamma distribution or "lognormal" for log normal distribution when variation = "frailty". Default is NULL.

base.parms

Vector of parameter values for baseline hazard function.

base.parms = c(lambda, rho), where lambda and rho are the shape and scale parameters, respectively. If base.dist = "logBurr" is chosen, three parameters should be specified for base.parms = c(lambda, rho, eta).

allelefreq

Vector of population allele frequencies of major and second disease gene alleles. Frequencies must be between 0 and 1. Default frequencies are 0.02 for major gene allele and 0.2 for second gene allele, allelefreq=c(0.02, 0.2).

dominant.m

Logical; if TRUE, the genetic model of the major gene is dominant, otherwise recessive.

dominant.s

Logical; if TRUE, the genetic model of the second gene is dominant, otherwise recessive.

mrate

Proportion of missing genotypes, value between 0 and 1. Default value is 0.

hr

Proportion of high risk families, which include at least two affected members, to be sampled from the two stage sampling. This value should be specified when design = "twostage". Default value is 0. Value should lie between 0 and 1.

probandage

Vector of mean and standard deviation for the proband age. Default values are mean of 45 years and standard deviation of 2 years, probandage = c(45, 2).

agemin

Minimum age of disease onset or minimum age. Default is 20 years of age.

agemax

Maximum age of disease onset or maximum age. Default is 100 years of age.

Details

The power of testing H0: bgene = 0 vs. H1: bgene = effectsize is obtained by the proportion of times the null hypothesis is rejected out of the N.sim simulations.

When interaction = TRUE, the powers of both the main effect of mutated gend and the interaction effect of mutated gene and gender will be computed.

Value

Returns

power

Power of detecting the genetic effect.

Author(s)

Yun-Hee Choi

See Also

simfam

Examples

    
## Example 1: obtain the power for testing the genetic effect 
# based on 50 POP families simulated using 100 simulations
## Not run: 
set.seed(4321)
fampower(N.fam = 50, N.sim = 100, effectsize = 1, beta.sex = 0.8, alpha = 0.05, side = 2, 
design = "pop+", variation = "none", base.dist = "Weibull", allelefreq = 0.02, 
base.parms = c(0.01, 3))
## End(Not run)
    
## Example 2: obtain the power for both the main and interaction effects  
# based on 50 POP families simulated using 100 simulations
## Not run: 
set.seed(4321)
fampower(N.fam = 50, N.sim = 100, effectsize = c(1.5, 1), beta.sex = 0.8, alpha = 0.05, 
side = 2, interaction = TRUE,  design = "pop+", variation = "none", base.dist = "Weibull", 
allelefreq = 0.02, base.parms = c(0.01, 3))
## End(Not run)

FamEvent documentation built on Nov. 17, 2022, 5:06 p.m.