read.forwsim           package:seqdesphII           R Documentation

Read forward simulation output

Description:

     This functions reads from a number of files the results of the
     forward simulation.

Usage:

     read.forwsim(dir)

Arguments:

     dir: Directory containing the output files from the forward
          simulation. 

Details:

     '"read.forwsim"' looks for text files with very specific names.
     Failure to find them will cause an error. The required files are
     '"b0.sim","b1.sim","b2.sim","U.sim","nreco.sim","ntoreco.sim","pB.
     sim","n3.sim","dt.sim"'
     ',"errI.sim","errII.sim","mse.sim","traj.dsg","term.sim"'.

Value:

     A list containing the following elements: 

      b0: Vector of values of '"b0"'.

      b1: Vector of values of '"b1"'.

      b2: Vector of values of '"b2"'.

   bgrid: Matrix containing all combinations of '"b0"', '"b1"' and
          '"b2"' values.

       u: Mean utility (1 entry for each row in '"bgrid"'). Set to
          minimum value for those '"b0"','"b1"','"b2"' not evaluated in
          the simulation.

   nreco: Mean number of recommended treatments (1 entry for each row
          in '"bgrid"').

 ntoreco: Mean number of patients / number of recommended treatments (1
          entry for each row in '"bgrid"').

      pB: Mean posterior probability that future trial gives
          significant result (1 entry for each row in '"bgrid"').

      n3: Mean sample size for future trial (1 entry for each row in
          '"bgrid"').

      dt: Mean number of patients tested with each treatment (1 entry
          for each row in '"bgrid"').

     err: Mean type I & II error rates (1 entry for each row in
          '"bgrid"').

     mse: Estimated mean square error (1 entry for each row in
          '"bgrid"').

    traj: Some sample trajectories saved for the point specified by the
          argument 'uhat.bsave' in 'forwsim'. If the file is empty this
          component will contain an error message.

    term: Terminal decisions and posterior moments for sample
          trajectories saved for the point specified by the argument
          'uhat.bsave' in 'forwsim'. If the file is empty this
          component will contain an error message.

Author(s):

     David Rossell.

References:

     Rossell D, Mueller P, Rosner G. Screening Designs for Drug
     Development.

See Also:

     forwsim optbound

Examples:

     dir <- 'C:/R/R-2.2.1/library/forwsim/data'                              #read forward simulation output
     sim1 <- read.forwsim(dir)

     opt1 <- optbound(sim1,errImax=1,errIImax=1,util='u',smooth=FALSE)       #unconstrained optimization

