For our final week in training at The Data School, we had the opportunity to create our own datasets to answer a question of our own choosing using Mockaroo. This is a fantastic website that can be really tweaked in any way you want, especially in practicing creating dashboards to tell clear and concise stories, particularly in building in anomalies and patterns within the data.

Mockaroo Basics

Firstly, it doesn’t particularly matter what type of data you want to generate, it could be related to sports, healthcare, real estate, anything really, as long as you set the parameters correctly. Now Mockaroo has a lot of prebuilt types of data it can generate, and some of them can be quite useful, especially in creating names, addresses, and email addresses. It’s also smart enough to detect existing fields so the “Full Name” data will always be the combination of the “First Name” and “Last Name” and the email address will also always reference the name. A word of warning though that the address information can get really strange, especially when trying to add cities or states in non-American countries so be wary of that when trying to add a spatial component within Mockaroo.

Weighted and Dynamic Distributions

One of the best parts of Mockaroo is the ability to skew data in whatever you want, which is valuable when using this data for visualisation as it builds in outliers, stories, and trends in the way you want it to. Again, in a word of warning, the default Normal Distribution option will always end up evening out to whatever your median is. So if I wanted to recreate the Superstore Orders sheet and include some additional information such as age, Mockaroo will ask you for a mean and a standard deviation. If you’re relying on this age field in another row, and chose random distribution for your ages in the options, the overall average and count of each age range will be close to evenly distributed based on your median and standard deviations just due to how the initial Normal Distribution was set up.

In order to set this up correctly, you want to look at the dynamic or weighted distribution, which is selected by clicking on the bar chart icon on the right of the field, and this allows you to get as detailed as you want. Weighted distribution just lets you skew the data, with each number indicating how likely something is to appear.

Dynamic distribution, on the other hand, is where it gets really customised and exciting. If for example, you wanted people from a certain country or gender to have a skew in data, such as ordering more of a specific type of category from this hypothetical Superstore sheet, you can use lines of simple code to tell Mockaroo the settings for this random generation. Something like field(“FIELD NAME”) == “VALUE” will dictate how skewed or not skewed you want that specific value in the same way the weighted distribution works, however now only applying to whatever was specified in that line of code.

Mockaroo has a bevy of other features too, such as using Scenarios to generate a randomised selection of prices for products, and uploading sheets as datasets so you can refer to them in your Schemas. The possibilities are really endless simply due to how flexible the custom lists are and only really needing to know small bits of simple coding.

Daniel Yam
Author: Daniel Yam