The purpose of the plyr and dplyr libraries in R is to manipulate data with ease. As we’ve seen in a previous post, there are various methods of wrangling and summarising data in R. However, wouldn’t it be great if […]

Continue reading »# Category: R

# SARIMA: Forecasting seasonal data with Python and R

Please note that this website will soon update to michael-grogan.com. You can view the updated version of this post here. ARIMA (Autoregressive Integrated Moving Average) is a major tool used in time series analysis to attempt to forecast future values […]

Continue reading »# PostgreSQL Databases: Connect To R and Python

PostgreSQL is a commonly used database language for creating and managing large amounts of data effectively. Here, you will see how to: create a PostgreSQL database using the Linux terminal connect the PostgreSQL database to R using the “RpostgreSQL” library, […]

Continue reading »# Creating functions and using lapply in R

Functions are used to simplify a series of calculations. For instance, let us suppose that there exists an array of numbers which we wish to add to another variable. Instead of carrying out separate calculations for each number in the […]

Continue reading »# OLS and Logistic Regression Models in R

We use linear models primarily to analyse cross-sectional data; i.e. data collected at one specific point in time across several observations. We can also use such models with time series data, but need to be cautious of issues such as […]

Continue reading »# Chow Test For Structural Breaks in Time Series

A Chow test is designed to determine whether a structural break in a time series exists. That is to say, a sharp change in trend in a time series that merits further study. For instance, a structural break in one […]

Continue reading »# Decision Trees and Random Forests in R

Decision trees are a highly useful visual aid in analysing a series of predicted outcomes for a particular model. As such, it is often used as a supplement (or even alternative to) regression analysis in determining how a series of […]

Continue reading »# Data Cleaning, Merging and Wrangling in R

One of the big issues when it comes to working with data in any context is the issue of data cleaning and merging of datasets, since it is often the case that you will find yourself having to collate data […]

Continue reading »# neuralnet: Train and Test Neural Networks Using R

Please note that this website will soon update to michael-grogan.com. You can view the updated version of this post here. A neural network is a computational system that creates predictions based on existing data. Let us train and test a […]

Continue reading »# rvest: Web Scraping Using R

rvest is one of the standard libraries when it comes to web scraping using R. In the following example, we use R to import a sample table from this webpage using the aforementioned library.

Continue reading »