evaluate_power {PopED}R Documentation

Power of a design to estimate a parameter.

Description

Evaluate the power of a design to estimate a parameter value different than some assumed value (often the assumed value is zero). The power is calculated using the linear Wald test and the the design is defined in a poped database.

Usage

evaluate_power(
  poped.db,
  bpop_idx,
  h0 = 0,
  alpha = 0.05,
  power = 0.8,
  twoSided = TRUE,
  find_min_n = TRUE,
  fim = NULL,
  out = NULL,
  ...
)

Arguments

poped.db

A poped database

bpop_idx

Index for an unfixed population parameter (bpop) for which the power should be evaluated for being different than the null hypothesis (h0).

h0

The null hypothesized value for the parameter.

alpha

Type 1 error.

power

Targeted power.

twoSided

Is this a two-sided test.

find_min_n

Should the function compute the minimum n needed (given the current design) to achieve the desired power?

fim

Provide the FIM from a previous calculation

out

provide output from a previous calculation (e.g., calc_ofv_and_fim, ...)

...

Extra parameters passed to calc_ofv_and_fim and get_rse

Value

A list of elements evaluating the current design including the power.

References

  1. Retout, S., Comets, E., Samson, A., and Mentre, F. (2007). Design in nonlinear mixed effects models: Optimization using the Fedorov-Wynn algorithm and power of the Wald test for binary covariates. Statistics in Medicine, 26(28), 5162-5179. doi: 10.1002/sim.2910.

  2. Ueckert, S., Hennig, S., Nyberg, J., Karlsson, M. O., and Hooker, A. C. (2013). Optimizing disease progression study designs for drug effect discrimination. Journal of Pharmacokinetics and Pharmacodynamics, 40(5), 587-596. doi: 10.1007/s10928-013-9331-3.

See Also

Other evaluate_design: evaluate.fim(), evaluate_design(), get_rse(), model_prediction(), plot_efficiency_of_windows(), plot_model_prediction()

Examples

# Folowing the examples presented in Retout, 2007

ff <- function(model_switch,xt,parameters,poped.db){
  with(as.list(parameters),{
    
    lambda1 <- lam1a
    if(TREAT==2) lambda1 <- lam1b
    
    y=log10(P1*exp(-lambda1*xt)+P2*exp(-lam2*xt))
    
    return(list(y=y,poped.db=poped.db))
  })
}

sfg <- function(x,a,bpop,b,bocc){
  parameters=c(P1=exp(bpop[1]+b[1]),
               P2=exp(bpop[2]+b[2]),
               lam1a=exp(bpop[3]+b[3]),
               lam1b=exp(bpop[3]+bpop[4]+b[3]),
               lam2=exp(bpop[5]+b[4]),
               TREAT=a[1])
  return(parameters) 
}
  

poped.db <- create.poped.database(ff_fun = ff,
                                  fg_fun = sfg,
                                  fError_fun = feps.add,
                                  bpop=c(P1=12, P2=8,
                                         lam1=-0.7,beta=0,lam2=-3.0),
                                  d=c(P1=0.3, P2=0.3,
                                      lam1=0.3,lam2=0.3), 
                                  sigma=c(0.065^2),
                                  groupsize=100,
                                  m=2,
                                  xt=c(1, 3, 7, 14, 28, 56),
                                  minxt=0,
                                  maxxt=100,
                                  a=list(c(TREAT=1),c(TREAT=2)))

plot_model_prediction(poped.db)
evaluate_design(poped.db)

poped.db_2 <- create.poped.database(poped.db,bpop=c(P1=12, P2=8,
                                      lam1=-0.7,beta=0.262,lam2=-3.0))

plot_model_prediction(poped.db_2)
evaluate_design(poped.db_2)

evaluate_power(poped.db_2,bpop_idx = 4)

[Package PopED version 0.6.0 Index]