Blog

Using R and clinical heuristics to explore the Heritage Health Prize: what do we gain?

The recent opening of the Heritage Health Prize both represents a milestone and raises a cautionary flag. On the one hand, crowdsourced analytics prizes have never tackled anything so noble (not to discount predicting movie ratings), but on the other hand, are we just looking for nails because we all have hammers? There is a great introduction…

Keep Reading
Blog

Speeding up agent-based simulations with data frames in R

In health economics it is common to use agent-based simulations for exploring epidemiological models, prevention policies, and clinical interventions, among other things. In C++ I enjoy using object-oriented design to build these agent-based models. It feels so natural. In R, however, I have yet to delve into the S4 object model, and so have instead resorted…

Keep Reading
Blog

Calculating the mixing matrix and assortativity coefficient with igraph in R

The mixing matrix of a graph gives the density of edges between vertices with different characteristics. The mixing matrix for a given igraph object can be calculated using the following function:   # calculate the mixing matrix of in igraph graph object ‘mygraph’, by some vertex attribute ‘attrib’ # can change the default use.density=FALSE to…

Keep Reading
Blog

Rcpp is smoking fast for agent-based models in data frames

In a previous post, I discussed different approaches to speeding up some loops in data frames. In particular, R data frames provide a simple framework for representing large cohorts of agents in stochastic epidemiological models, such as those representing disease transmission. This approach is much easier and likely faster than trying to implement cohorts of R…

Keep Reading
Blog

New season of Grey’s Anatomy with Exponential Random Graph Models

In a previous post we used the web of sexual contacts among characters on the Grey’s Anatomy television show to look at some social network analysis using R. To celebrate the beginning of the new season, Ben Lind has put together a Grey’s Anatomy tutorial on exponential random graph (ERG) models. Who knew popular culture could teach us so much…

Keep Reading
Blog

Perfect Summer Fruit Salad

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam molestie molestie nisl, eu scelerisque turpis tempus at. Nam luctus ultrices imperdiet. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Suspendisse velit orci, pretium ut feugiat nec, lobortis et est. Nullam cursus ultrices tincidunt. Nam gravida sem gravida ipsum dignissim in…

Keep Reading