Brextract: Extract a simulation from the output of emaxsim

"Extract.emaxsim"R Documentation

Extract a simulation from the output of emaxsim

Description

Extract a simulated data set from the output of emaxsim. Data are re-created using the stored random number seed.

Usage

## S3 method for class 'emaxsim'
x[i, ...]

Arguments

x

Output object from emaxsim

i

Simulation replication to extract

...

Parameters passed to other functions (none currently)

Details

Re-creates the ith simulated data set for subsequent analyses. Also returns all analyses done for the ith data set in emaxsim

Value

A list is returned with class(emaxsimobj) containing:

y

Response vector

dose

Doses corresponding to y

pop

Population parameters; type of parameter depends on constructor function generating study data.

popSD

Vector containing the population SD used to generate continuous data. NULL for binary data.

init

Starting Emax parameters

est4

4-parmameter Emax fit (ed50,lambda,emax,e0). NA if failed to converge or 3-parameter model requested.

est3

3-parmameter Emax fit (ed50,emax,e0). NA if failed to converge or 4-parameter model successfully fit.

estA

Alternative parameter estimates. NA if Emax model fit successfully

vc

The variance-covariance matrix of the model parameters for the selected model.

residSD

The residual SD based on the selected model.

bigC

bigC= TRUE if the primary fit (from modType) yielded an ED50 > ED50 upper limit.

negC

negC= TRUE if the primary fit (from modType) yielded a negative ED50 estimate< ED50 lower limit

modType

When modType=4, the fitting begins with the 4 parameter model. If estimation fails or modType=3, the 3-parameter estimation is applied. If it fails, a best-fitting model linear in its parameters is selected.

fit

Output of model determined by fitType

fitType

Character vector with "4", "3", "L", "LL", or "E" for 4-Emax, 3-Emax, linear, log-linear, or exponential when an alternative model is selected.

ed50cutoff

Upper allowed limit for ED50 estimates.

ed50lowcutoff

Lower allowed limit for the ED50 estimates.

switchMod

If switchMod is TRUE, the algorithm substitutes a simpler model if (1) convergence is not achieved, (2) the information matrix is not positive definite at the converged values, (3) the ED50 estimates are outside the cutoff bounds. If switchMod is F, only conditions (1) or (2) cause a simpler model to be used.

PL

T if the 'plinear' algorithm in nls converged

predpop

Population means for each dose group

dm

Vector containing dose group means

dsd

Vector containing dose group SDs

fitpred

Dose groups means estimated from the model

sepred

SEs for estimates in fitpred

sedif

SEs for model-based estimates of difference with placebo

pVal, selContrast

P-value and contrast selected from MCP-MOD test

idmax

Index of default dose group for comparison to placebo

Note

Extraction from a simulation object requires re-creation of the simulated data set. If the extracted object is to be used more than once, it is more efficient to save the extracted object than reuse [].

Author(s)

Neal Thomas

See Also

emaxsim, print.emaxsimobj, plot.emaxsimobj, update.emaxsimobj

Examples


## Not run: 
## code change random number seed

nsim<-50
idmax<-5
doselev<-c(0,5,25,50,100)
n<-c(78,81,81,81,77)

### population parameters for simulation
e0<-2.465375 
ed50<-67.481113 

dtarget<-100
diftarget<-9.032497
emax<-solveEmax(diftarget,dtarget,log(ed50),1,e0)

sdy<-7.967897
pop<-c(log(ed50),emax,e0)    
meanlev<-emaxfun(doselev,pop)  

###FixedMean is specialized constructor function for emaxsim
gen.parm<-FixedMean(n,doselev,meanlev,sdy)  

D1 <- emaxsim(nsim,gen.parm,modType=3)
e49<-D1[49]                  #### extract 49th simulation


## End(Not run)


clinDR documentation built on Aug. 9, 2023, 9:08 a.m.