######### Validation of prediction models with a binary outcome #########
data(EuroSCORE)
# Meta-analysis of the c-statistic (random effects)
fit <- valmeta(cstat=c.index, cstat.se=se.c.index, cstat.cilb=c.index.95CIl,
cstat.ciub=c.index.95CIu, cstat.cilv=0.95, N=n, O=n.events,
slab=Study, data=EuroSCORE)
plot(fit)
# Nearly identical results when we need to estimate the SE
valmeta(cstat=c.index, N=n, O=n.events, slab=Study, data=EuroSCORE)
# Two-stage meta-analysis of the total O:E ratio (random effects)
valmeta(measure="OE", O=n.events, E=e.events, N=n, slab=Study, data=EuroSCORE)
valmeta(measure="OE", O=n.events, E=e.events, data=EuroSCORE)
valmeta(measure="OE", Po=Po, Pe=Pe, N=n, data=EuroSCORE)
if (FALSE) {
# One-stage meta-analysis of the total O:E ratio (random effects)
valmeta(measure="OE", O=n.events, E=e.events, data=EuroSCORE, method="ML",
pars=list(model.oe="poisson/log"))
# Bayesian random effects meta-analysis of the c-statistic
fit2 <- valmeta(cstat=c.index, cstat.se=se.c.index, cstat.cilb=c.index.95CIl,
cstat.ciub=c.index.95CIu, cstat.cilv=0.95, N=n, O=n.events,
data=EuroSCORE, method="BAYES", slab=Study)
# Bayesian one-stage random effects meta-analysis of the total O:E ratio
# Consider that some (but not all) studies do not provide information on N
# A Poisson distribution will be used for studies 1, 2, 5, 10 and 20
# A Binomial distribution will be used for the remaining studies
EuroSCORE.new <- EuroSCORE
EuroSCORE.new$n[c(1, 2, 5, 10, 20)] <- NA
pars <- list(hp.tau.dist="dhalft", # Prior for the between-study standard deviation
hp.tau.sigma=1.5, # Standard deviation for 'hp.tau.dist'
hp.tau.df=3, # Degrees of freedom for 'hp.tau.dist'
hp.tau.max=10, # Maximum value for the between-study standard deviation
seed=5) # Set random seed for the simulations
fit3 <- valmeta(measure="OE", O=n.events, E=e.events, N=n, data=EuroSCORE.new,
method="BAYES", slab=Study, pars=pars)
plot(fit3)
print(fit3$fit$model) # Inspect the JAGS model
print(fit3$fit$data) # Inspect the JAGS data
}
######### Validation of prediction models with a time-to-event outcome #########
data(Framingham)
# Meta-analysis of total O:E ratio after 10 years of follow-up
valmeta(measure="OE", Po=Po, Pe=Pe, N=n, data=Framingham)
Run the code above in your browser using DataLab