Learn to use and visualize K-Means Cluster Analysis in R with the 2020 Economic Freedom Index Data from The Heritage Foundation

Cluster plot image made with K-Means and R | Image by Author
Cluster plot image made with K-Means and R | Image by Author
Cluster plot image made with K-Means and R | Image by Author

Objectives

  1. Use K-Means Clustering Algorithm in R

Introduction

K-Means clustering is an unsupervised machine learning technique that is quite useful for grouping unique data into several like groups based on the centers of the independent variables present in the data set [1]. A couple classic examples are clustering different types of customers in company loyalty programs and separating medical patients into low, medium, high, and extreme risk categories [1].

In…


Hands-on Tutorials

Using ARIMA models and the Case-Shiller Index with some creative R programming lets us predict national housing prices for the next year. How can that be?! Let’s find out!

Image for post
Image for post
Photo by Alex Vasey on Unsplash

Objectives

  1. Predict the next year of US housing prices

Introduction

This project is designed for two kinds of people — those interested in the code and those interested in the real estate market. While the concepts will be presented with technical definitions and code examples, it will not be necessary to understand the code to learn about cyclical the nature of housing prices, predictive modeling, or economic data.

For those just reading along, try not to get caught…


Let me share the glory of the full_join() function with you using the R language!

Image for post
Image for post
Photo by Martin W. Kirst on Unsplash

Have you ever been working with multiple tables of data in R and had trouble merging them into a single table? Did you go to Google to tell you to “just use rbind” or see four different ways of joining other people’s data that doesn’t make sense? Well, I have too and so have many of my students.

Here is a concise little guide to how to use rbind, several kinds of joins, and how to resolve common issues when using these functions!

For your…


Real minimum wage has actually never been that high in US history.

Image for post
Image for post
Photo by Ben White on Unsplash

TL;DR — yes. Long answer — probably. Here’s why.

Why Bother?

So, I read your comments on my Good Luck With That $15 Minimum Wage, Grocery Workers article and got quite a diverse set of responses ranging in sentiment from “Yeah! Minimum wage is dumb” to “This is a cruel way to look at the world” to “Economics is fake news” as well as some really interesting and well defined responses that truly contributed to a robust discussion. Well, I’m back and ready for round 2. Are you?

Is Minimum Wage Always Bad?

It depends…


AI-powered shopping carts are here to take your jobs because of basic economics.

Image for post
Image for post
Photo by Icons8 Team on Unsplash

Robots Are Taking Their Jobs!

Today I stumbled on an article about how AI-powered shopping carts are coming to Kroger grocery stores [1]. The message here is crystal clear.

If your job involves standing around doing something that can be readily done by a machine, $15 an hour minimum wage is not going to save you.

As President Biden and many others have called for a federally mandated $15 minimum wage that “could lift 1 million people out of poverty” as a major benefit to normal working people people, this is based on a tenuous economic proposition [2]. …


Use real European economic data to learn about data wrangling, cleaning, and efficient plotting using an Excel file.

Image for post
Image for post
Photo by Adam Nowakowski on Unsplash

Objectives

  1. Download, extract, and load complex Excel files from the web into R

Introduction

Have you ever had a data set with hundreds of columns that repeat and just need a simple way to get some useful plots of the data? Well, you are in the right place!

In this project, I will show you the simplest and most effective tips…


Learn about the Economics of Equilibrium using R and ggplot2

Image for post
Image for post
Photo by rupixen.com on Unsplash

Welcome to part 3 of the Economics for Tech People series!

This series is intended to help people better understand fundamental principles of economics while also building up skills with the R language. I have noticed there is quite a bit of misunderstanding and outright misinformation about economics, so the goal here is to clear up these fuzzy areas.

In this article, we will explore questions such as: What is equilibrium? How can I find the equilibrium price and quantity? What happens when the numbers do not work out perfectly? How much revenue can I expect to make?

This article…


Learn about the Economics of Demand using R and ggplot2

Image for post
Image for post
Photo by Science in HD on Unsplash

Welcome to part 2 of the Economics for Tech People series!

This project is designed to help people learn about fundamental economics concepts and R programming at the same time. I have noticed there is quite a bit of misunderstanding and outright misinformation about economics, so the goal here is to clear up these fuzzy areas.

What is supply? Who supplies things? What is the difference between quantity supplied and supply? How much should I make of my good or service? How can I figure out the maximum total revenue?

I will be referencing many points of my previous article…


Learn about the Economics of Demand using R and ggplot2

Image for post
Image for post
Photo by Giorgio Trovato on Unsplash

This project exists because I have noticed that there is a tremendous amount of misunderstanding about what the word “demand” actually means in an economic context, especially in the world of technology.

Who demands things? What is a curve? Why does the demand curve change? Why is it wrong to say that a change in price means a change in demand? What is the difference between demand and quantity demanded? What does elasticity even mean? How can I figure out the maximum total revenue?

Introduction

What we are going to do in this article is explore concepts in demand using R…


Use historical baseball data and logistic regressions with R to predict the number of runs scored in World Series games.

Stadium with a crowd for baseball
Stadium with a crowd for baseball
Photo by Tim Gouw on Unsplash

Introduction

Have you ever wondered what American baseball, machine learning, and statistics have in common? Well, you’re in luck today!

In this project, we are going to use some freely available historical baseball data with the glm() function in R to see what variables matter in predicting how many home runs happen in games in the World Series.

There are a couple assumptions with this project. First, you have an R environment setup. I am going to be using an R Markdown (RMD) file in RStudio on a Mac for this project, but the code will work on other operating systems…

Tyler Harris

I write about technology and business. Working on a PhD in IT. Have a MS in IT & a BS in Economics with CompTIA Security+, Network+, and A+ certifications.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store