R

multistateutils v1.2.0 released

A new version of multistateutils has been released onto CRAN containing a few new features. I’ll give a quick overview of them here, but have a look at the vignette for more examples. msprep2 The first is a replacement for the mstate::msprep function that converts data into the long transition-specific format required for fitting multi-state models. msprep requires the input data to be a in a wide format, where each row corresponds to an individual and each possible state has a column for entry time and a status indicator.

Evaluating the Predictaball football rating system - 2018

Having become interested in football again due to the World Cup, I was thinking about Predictaball and how I never wrapped up the season with a brief review. It’s been a big season for Predictaball, with the move to an Elo-based system, as well as the launch of a website. However, is the new match forecasting method any good? Model accuracy Fortunately, to help answer this question, a very generous Twitter user by the name of Alex B has been collecting weekly Premiership match predictions from around 30 models and tracked their progress.

multistateutils: functions for using multi-state models in R

A month ago I mentioned that I’d been using a discrete event simulation for estimating transition probabilities from parametric multi-state models. I’ve now turned this code into a general package containing resources for multi-state modelling, called multistateutils (I know, I’m very imaginative) which may be of interest to other people working with multi-state models in R. The current release is available on CRAN, while the development is still on GitHub.

rprev 1.0.0 released with lots of new features

I’m very happy to announce the first ‘official’ release of version 1.0.0 of rprev, the R package for estimating disease prevalence by simulation. This is useful for epidemiologists who have registry data and want to know disease prevalence from time periods longer than is covered by the registry. I first released it almost exactly two years ago but had always intended to update it with the features in this release.

rdes: Discrete event simulation in R for estimating transition probabilities from a multi-state model

I’ve just released an R package for estimating transition probabilities from multi-state models onto Github, found at https://github.com/stulacy/RDES. It’s not a package with a large potential audience, so I don’t intend to release it onto CRAN, rather it has a highly specific role that I developed for my own use and thought it could prove useful for someone else. Essentially, it extends the simulation functionality offered by the fantastic flexsurv package for obtaining predicted outcomes from multi-state models.

epitab - Contingency Tables in R

I’ve just released a new package onto CRAN and while it doesn’t perform any complex calculations or fit a statistical niche, it may be one of the most useful everyday libraries I’ll write. In short, epitab provides a framework for building descriptive tables by extending contingency tables with additional functionality. I initially developed it for my work in epidemiology, as I kept coming across situations where I wanted to programmatically generate tables containing various descriptive statistics to facilitate reproducible research, but I could not find any existing software that met my requirements.

A Multi-State Modelling web app

A web app built in Shiny to visualise Multi-State Models

rprev

An R package for estimating disease prevalence from registry data

Simulating win probabilities of the CamelUp boardgame

Camel Up is a deceptively simple board game in which the aim is to predict the outcome of a camel race. I’ll quickly try to explain the game now, although it’s always hard to explain a boardgame without an actual demonstration. The camel movement is randomly generated from dice rolls as follows. Five dice coloured for each of the five camels, each labelled with the numbers 1-3 twice, are placed into a container (decorated as a pyramid, since the game is set in Egypt), which is then shaken.

An interactive Multi-State Modelling Shiny web app

In the last couple of months I’ve been teaching myself about multi-state survival models for use in an upcoming project. While I found the theoretical concepts relatively straight forward, I started having issues when I began to start implementing the models in software. There are many considerations to be made when building a multi-state model, such as: Convert the data into a suitable long format Deciding whether to use either parametric or semi-parametric models Different subsets of the available covariates can be selected for each of the transition hazards In addition, covariates can be forced to have the same hazard ratio on every transition There’s a choice to be made between clock-forward or clock-reset (semi-Markov models) time-scales The Markov assumption can be further violated by including the state arrival times as part of the transition hazard; this often has theoretical justification The baseline hazards can be kept stratified by transition, or certain ones can be assumed to be proportional Needless to say, actually building a model was very time consuming.