## Multiple linear regression in R In a previous blog, we applied simple linear regression to an interesting problem: how well does a measure of wine density account for alcohol content. This was considered simple linear regression because we had one outcome variable (alcohol content) and one predictor variable (wine density). We can extend this approach to have more than one predictor. Specifically, we can use

## Don’t repeat yourself: Python modules We previously learned to create our own Python functions to reduce how much we repeat ourselves in our code. In this post we see another example of the DRY principle (don’t repeat yourself) and we will learn how to ensure we don’t repeat ourselves between the different programs we write. A typical (bad) script to process data Below is an

## Don’t repeat yourself: Python functions Learning to program is not easy. We have to learn a new language and a new way of thinking. We have to learn the grammatical rules of the programming language we are learning, and the logic of our program, how it will work its way through the code and hopefully give us the answer we expect. In this post we

## Simple linear regression in R In statistics, we often want to fit a statistical model to be able to make broader generalizations. An important type of statistical model is linear regression, where we predict the linear relationship between an outcome variable and a predictor variable. In this post we will learn how to perform a simple linear regression in R. See our previous post for

## Simple linear regression Linear regression is one of the most versatile tools in the data analyst’s toolbox. While it can get quite complicated, simple linear regression is rather intuitive and straightforward. In this post we will look at a small dataset so that we can work through and visualise the logic of linear regression. A bigger version of this dataset will be used 