rankObject: generic function to calulate a 'ranking'-slot

Description Usage Arguments Details Value Note Examples

Description

generic function to calulate a ranking-slot

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
rankObject(object, ...)

fastRankSchemes(object, pkData, objective, nCores = 1)

## S4 method for signature 'SetOfSchemes'
rankObject(object, pkData, objective,
  varianceMeasure = "var", scaleWith = "max", skipTests = FALSE,
  nCores = 1)

## S4 method for signature 'SetOfTimePoints'
rankObject(object, pkData, nGrid = 100,
  nSamplesAvCurve = 1000, useAverageRat = FALSE, avCurve = NULL,
  nCores = 1)

Arguments

object

a S4 class object

...

additional parameters

pkData

PkData-class

objective

a data.frame with columns:

  • criterion summary function of an estimeted pkCurve (data frame with columns time and concentration): area under the curve (auc) ; maximum concentration (cMax) and time when the maximum concentration is reached (tMax); user defined functions are alowed but prefix pkCurveStat_ should be added in function definition, see examples pkCurveStat

  • weight relative importance of the different criteria

nCores

number of cores used in parellel processing, defaults to 1

varianceMeasure

variance criteria applied to the objective, defaults to summarise objective over sample data, defaults to var

scaleWith

function to scale different criteria in objective before combining results by taking a weighted sum

skipTests

if TRUE object validity and compatibility is not tested, defaults to FALSE , doing these tests is slow

nGrid

number of equally spaced point to calculate the distance between sample and population averaged kinetic curve, defaults to 100

nSamplesAvCurve

the number of samples to calculate the averaged curve ( only to rank SetOfTimePoints-class), defaults to 1000

useAverageRat

logical value if TRUE, the average rat (with random effects equal to zero and no additional error) is used instead of the integrated out population averaged curve, defaults to FALSE; this is faster but biased

avCurve

a user specified averaged curve, when specified, the average curve is no longer calculated from the pkModel, defaults to NULL

Details

fastRankSchemes is a faster version to rankSetOfSchemes-class objects , with fixed settings ( objective AUC and cMax , summary measure is variance and scale measure is maximum ). It is meant to be used inside the shiny application

Value

SetOfSchemes-class object

Note

when ranking SetOfSchemes-class using if multiple criteria, the combined criterion is rescaled such that the best result is 1

if SetOfTimePoints-class timePoints are ranked according to mimimal distance between population average curve and the estimate of the population average curve based on a selection of time points.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
## Not run: 
  setOfSchemes             <-  getExampleSetOfSchemes()
  dataForSchemes            <-  getExampleData()
  ex1       <-  rankObject( object = setOfSchemes, dataForSchemes ,
    objective = data.frame( criterion = "auc" , weight = 1 ) )
  getRanking(ex1) # to get the dataframe and not the whole object
  ex2       <-  rankObject( object = setOfSchemes, dataForSchemes ,
    objective = data.frame( criterion = "auc" , weight = 1 )  ,
    varianceMeasure = "sd" , scaleWith = "min" ) 
  getRanking(ex2) 
  ex3       <-  rankObject( object = setOfSchemes, dataForSchemes ,
    objective = data.frame( criterion = c( "auc" , "cMax" , "tMax" )  ,
     weight = c( 9 , 1, 1 ) ) ) 
  getRanking(ex3)

  # example with own defined varianceMeasure
  rangeWidth     <-  function( x ){
     range <-  range(x) ;
     rangeWith  <-  range[2] - range[1]; rangeWith
   }
  ex4       <-  rankObject( object = setOfSchemes, dataForSchemes , 
      objective = data.frame( criterion = c( "auc" , "cMax" , "tMax" )  , 
      weight = c( 9 , 1, 1 ) ) ,
      varianceMeasure = "rangeWidth" ,
      scaleWith = "mean" ) 

## End(Not run)
## Not run: 
 fullTimePoints    <-  0:10
 setOfTimePoints   <-  getExampleSetOfTimePoints( fullTimePoints)
 pkDataExample     <-  getPkData( getExamplePkModel() , getTimePoints( setOfTimePoints ) , 
   nSubjectsPerScheme = 5 , nSamples = 17   )
 ex1               <-  rankObject( object = setOfTimePoints , pkData = pkDataExample ,
     nGrid = 75 , nSamplesAvCurve = 13)
 ex2               <-  rankObject( object = setOfTimePoints ,   pkData = pkDataExample , 
     nGrid = 75 , nSamplesAvCurve = 13 , useAverageRat = TRUE )
 ex3               <-  rankObject( object = setOfTimePoints ,   pkData = pkDataExample ,
     nGrid = 75 , avCurve = rep(0 , length(fullTimePoints) ) )

## End(Not run)

microsamplingDesign documentation built on Oct. 13, 2021, 5:10 p.m.