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 »Category: R
Text Mining and Search Analytics Using Python and R
The following example illustrates how text mining capabilities in Python and R can be used in order to analyse a text file with a set of words, and how these words can be split into separate categories with the frequency […]
Continue reading »neuralnet: Train and Test Neural Networks Using R
A neural network is a computational system frequently employed in machine learning to create predictions based on existing data. In this example, we will use the neuralnet package in R to train and test a neural network model. A typical […]
Continue reading »Non-Normal Data: Shapiro Test and Box-Cox Transformation
Non-normal data is a common occurrence when conducting data analysis. When we work with a particular dataset, we are making an assumption that the distribution of the data is normal. This is because data becomes significantly easier to forecast when […]
Continue reading »Decision Trees in R: Classification and Regression Trees
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 »kmeans and wss: Find optimal number of clusters (k)
A K-Means Clustering algorithm allows us to group observations in close proximity to the mean. This allows us to create greater efficiency in categorising the data into specific segments. Here is how the wss command is used to firstly determine […]
Continue reading »Import Data Types Into R
The below snippets of code illustrate how to import data into R from several different formats. Import data in CSV format mydata = read.csv(“C:/R/MGFinance.csv”) #read csv file mydata Import data in JSON format install.packages(“jsonlite”) library(jsonlite) data
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. With the sample table below containing […]
Continue reading »Statistical Power Calculation Using R (power.t.test)
The statistical power of a test allows us to determine the minimum sample size that would be expected to yield significant results for a test. In R, this can be calculated by using the power.t.test command. We have already discussed […]
Continue reading »