As most readers will know, this Thursday (18th September 2014), residents of Scotland will vote in a referendum to decide whether to become independent of the UK. While the No campaign had previously maintained a reasonably healthy lead against Yes, in recent weeks the race has tightened considerably, on the basis of polls of voting intentions. In particular, two polls have now shown larger proportions saying they will vote Yes compared to the proportions voting No. With a flurry of polls conducted in the last week, each with slightly different results, I decided to perform a simple meta-analysis of the poll results, to estimate the current state of play, based on the available evidence.
Checking functional form in logistic regression using loess plots
When we include a continuous variable as a covariate in a regression model, it’s important that we include it using the correct (or something approximately correct) functional form. For example, with a continuous outcome Y and continuous covariate X, it may be the case that the expected value of Y is a linear function of X and X^2, rather than a linear function of X. For linear regression there are a number of ways of assessing what the appropriate functional form is for a covariate. A simple but often effective approach is simply to look at a scatter plot of Y against X, to visually assess the shape of the association.
Using Stata’s sem to adjust for covariate measurement error
Covariate measurement error is a common issue in epidemiology. Many statistical methods have been developed for allowing for covariate measurement error over the last three decades or so. I’ve been playing around with Stata’s structural equation modelling builder, which enables one to allow for covariate measurement error using maximum likelihood for estimation. I’m still very much a beginner with structural equation models and Stata’s implementation of them, but hopefully this YouTube video is a useful illustration of just one of the things that’s possible with them.