power.cox: Compute the power of a single-predictor Cox regression model

Description Usage Arguments Value References Examples

View source: R/fdr-sampsize-v1.0e.R

Description

Use the formula of Hseih and Lavori (2000) to compute the power of a single-predictor Cox model.

Usage

1
power.cox (n, alpha, logHR, v) 

Arguments

n

number of events (scalar)

alpha

p-value threshold (scalar)

logHR

log hazard ratio (vector)

v

variance of predictor variable (vector)

Value

vector of power estimates for two-sided test

References

Hsieh, FY and Lavori, Philip W (2000) Sample-size calculations for the Cox proportional hazards regression model with nonbinary covariates. Controlled Clinical Trials 21(6):552-560.

Examples

1
2
3
4
5
6
7
8
 power.cox             # show the power.cox function
 res=fdr.sampsize(fdr=0.1,
                  ave.pow=0.8,
                  pow.func=power.cox,
                  eff.size=rep(c(log(2),0),c(100,900)),
                  null.effect=0,
                  v=1)
 res

Example output

function (n, alpha, logHR, v) 
{
    pnorm(qnorm(alpha/2), sqrt(n * v) * logHR) + 1 - pnorm(qnorm(1 - 
        alpha/2), sqrt(n * v) * logHR)
}
<environment: namespace:FDRsampsize>
          n       alpha     ave.pow     fdr.hat     act.fdr 
25.00000000  0.00868988  0.80002664  0.08907730  0.08905233 

FDRsampsize documentation built on May 2, 2019, 9:14 a.m.