# Sources of sample data for regressions

I'm looking for sample data to give algebra 2 students to teach about using Desmos to do regressions.

Some example data sets folks at my school already have compiled are:

• Number of Lego pieces vs Price of set (linear)
• Arm span vs Height of person (linear)
• Number of years since 1948 vs Average movie ticket price (linear or exponential)
• Dollars spent on advertisements vs Dollars earned as revenue (square root)
• NBA draft pick number vs Salary in dollars (exponential decay)

Just to name a few. We would like to add to our collection for each of the following function families:

• Linear
• Absolute Value
• Cubic (and higher degree polynomials)
• Square root
• Reciprocal (or other rational functions)
• Exponential (growth and decay)
• Logarithmic
• Sine or Cosine

An ideal answer would provide sources of bivariate data from the various function families. Does such a compilation exist online already? Is there a good textbook that has this type of thing?

In particular, we're having trouble finding data modeled by absolute value functions. I thought of vehicle MPG vs Speed, but couldn't find much real data.

It is not critically important that the data be real. Thank you!

• There is an OpenData stack where you might find good answers although if you cross-post be sure to add that info in both sites. Do not post on CrossValidated as it will be closed there in favour of OpenData. Commented Jan 25 at 16:40
• These might be useful to you. Leaving as a comment rather than an answer because I am not pairing these datasets with function families as requested. lock5stat.com/datapage3e.html Commented Jan 29 at 11:42
• That's very useful! Thanks for sharing. Commented Jan 30 at 0:42

This might be an interesting task. It is based on what is called Zipf's Law. Roughly it states that the frequency distribution of words in a typical passage of text of natural language follows a curve $$\displaystyle{f(r)=\frac{1}{r^\alpha}}$$ Here $$r$$ is the "rank" of the word. For example, the most frequently occurring word tends to be "the" so "the" is first in rank. Typically the exponent $$\alpha$$ is slightly larger than 1. You can find $$\alpha$$ by regression.

Now to collect data, go to a source like Project Gutenberg and find a passage of something like five paragraphs. You can of course use a passage from anywhere, but Project Gutenberg seems appropriate for education.

Next go to ChatGPT and say

"Give me word frequencies for the follow passage, ignoring capitalization. Sort into decreasing order. and paste the copied text.

You will get something like this. You can ask for the data in a format that you can manipulate with a spreadsheet, such as csv.

At the bottom of the list will be the words that occurred just once, the so-called hapaxes

[Single occurrence words]: 'used', 'so', 'frightened', 'when', 'my', 'turn', 'big', 'crown', 'on', 'see', 'give', 'presents', 'kiss', 'liked', 'kisses', 'dreadful', 'have', 'looking', 'while', 'opened', 'bundles',

Here are two resources off the top of my head that exercise a variety of function families:

Infections at the beginning of the COVID-19 pandemic
linear, exponential growth/decay, sine/cosine

• Spring 2020 - Summer 2020 | the number of daily new cases increased linearly, and the total cumulative number of cases grew exponentially.

• Fall 2020 - Fall 2021 | the number of daily new cases oscillated sinusoidally, and the total cumulative number of cases increased roughly linearly.

• Winter 2022 - Summer 2023 | the number of daily new cases decayed roughly exponentially.

A made-up rocket launch data set (height of rocket vs time elapsed since launch)