160 likes | 299 Views
Uncertainty Analyses. Latin hypercube method implemented in POHEM Tamoxifen example Bill Flanagan Philippe Finès Feb 9, 2010. Generating lognormal deviate . 1) Computation of sigma for ( i = 0; i < SIZE( TAMOXIFEN_RR_AGE_GROUP ); i++ ) {
E N D
Uncertainty Analyses Latin hypercube method implemented in POHEM Tamoxifen example Bill Flanagan Philippe Finès Feb 9, 2010
Generating lognormal deviate • 1) Computation of sigma for ( i = 0; i < SIZE( TAMOXIFEN_RR_AGE_GROUP ); i++ ) { for ( j = 0; j < SIZE( TAMOXIFEN_RELATED_DISEASES ); j++ ) { if ( TAMOXIFEN_CALCULATE_SIGMA ) { mTamoxifen_RR_STD_LN[i][j] = (( log( TAMOXIFEN_RRISK[i][j][2] ) - log( TAMOXIFEN_RRISK[i][j][1] ) ) / TAMOXIFEN_RR_CI ) / 2; ex: (UCI-LCI) /1.96/2 } else {mTamoxifen_RR_STD_LN[i][j] = TAMOXIFEN_RR_SIGMA[i][j];} } } • 2) Generation of a lognormal random variable /* The RR is assumed to be lognormal. When calculating the mean for the lognormal from a normal there is an adjustment factor of exp(sigma^2 / 2) */ mTamoxifen_RR[s][i][j] = TAMOXIFEN_RRISK[i][j][0] / exp( pow( mTamoxifen_RR_STD_LN[i][j], 2) / 2 ) * exp( mTamoxifen_RR_STD_LN[i][j] * dRand );
Generating lognormal deviate • Normal distribution • mean=m , sd=s • draw Z ~ N(0,1) • X = m+Z*s~ N(m,s²) • Lognormal distribution • Y ~ lognormal(m,s²) ln(Y)~N(m,s²) • mean=exp(m + s²/2)=exp(m) exp(s²/2) , • sd=sqrt[(exp(s²)-1)(exp(2m + s²))] • draw Z ~ N(0,1) • X = exp(m+Z*s)/exp(s²/2) = exp(m) exp(Z*s)/exp(s²/2)~ lognormal(m,s²)
Interpreting and Using RCT results • RCT tamoxifen trial • control vs tamoxifen • TAMOXIFEN_RRISK • by age, disease and estimate (mean, lci, uci) • model generated rTamoxifen_RR
Using Subsamples • Subsamples • when a person is first created in POHEM they are randomly assigned to a subsample • subsamples generated automatically by Modgen • user picks the total number in Scenario Settings ( eg 40) • Presimulation • generate a vector of RR for each subsample • RR from lognormal distribution defined by RCT mean and CI • by age group and disease • CaseSimulation • during code execution of an individual simulated life course • the risk equation for each disease is multiplied by the RR given the person’s subsample (and age) • use GetCaseSample() in code to know person’s subsample
Looking in the code • Presimulation code • can be in any mpp • see Otherhealth.mpp • starts in line 18 but important part in line 369
Presimulation code for ( s = 0; s < SIZE( MAX_SUBSAMPLES ); s++ ) { for ( i = 0; i < SIZE( TAMOXIFEN_RR_AGE_GROUP ); i++ ) { for ( j = 0; j < SIZE( TAMOXIFEN_RELATED_DISEASES ); j++ ) { /* The RR is assumed to be lognormal. When calculating the mean for the lognormal from a normal there is an adjustment factor of sigma^2 / 2 The reference for this is the Handbook of the Normal Distribution Patel and Read page 24. */ // We further decided to limit to the 95% confidence interval to avoid outliers do { dRand = RandDeviate(7); } while ( fabs( dRand ) > 1.96 ); mTamoxifen_RR[s][i][j] = TAMOXIFEN_RRISK[i][j][0] / exp( pow( mTamoxifen_RR_STD_LN[i][j], 2) / 2 ) * exp( mTamoxifen_RR_STD_LN[i][j] * dRand ); } } }
CaseSimulation void Person::StartTamoxifen() {... for ( i = 0; i < SIZE( TAMOXIFEN_RELATED_DISEASES ); i++ ) { s = GetCaseSample(); rr_tamoxifen[i]=mTamoxifen_RR[s][tamoxifen_rr_age_index][i]; } } void Person::BreastCancerCheck() { ... bc_relative_risk = ... * rr_tamoxifen[TAM_BREAST]; nProb_breast_incidence = Breast_prob[curtate_age] * bc_relative_risk; ... }
Output • Export Tables to Excel • in the Output contents window, check each of the subsamples • one workbook per subsample for each table • naming convention SUB#_<table name> • plus one series of new tables called trun, SUB#_trun • analyse differences in outcomes (e.g. life expectancy) between subsamples in each workbook (manual calculations)
Example: Results on HUI in POHEM-OA from perturbations of the parameters Philippe Finès August 2009
Average HUI, original values and values from 10 realisations of parameters, females
Average HUI, original values and values from 10 realisations of parameters, males
Average HUI in 2020, original values and some statistics on the values, females
Average HUI in 2020, original values and some statistics on the values, males
Average HUI in 2020, original values, mean and median, females