know.

CookbookTeaching and coursesNo. 19

An open textbookchapters drafted in the open and released under a Creative Commons licence

Recipe No. 19 · Teaching and courses

For: An instructor writing an open statistics textbook

You get: An open statistics textbook, each chapter on its own public link

Time: A term, about a chapter a fortnight

See it in know.sh

A worked example as a section: the table, a histogram of the sample, the R code and its interval, and a proposed note about rounding.

Counting on ItChapter 5

3of 9

Confidence interval for a mean

Evidence, key section, 1 highlight, 1 note, 3 sources, 610 words

A city transport survey publishes the one-way commuting times of people who answered it. We take a random sample of 24 and estimate the mean commute for everyone who answered.

SamplenMean (minutes)Standard deviation
Transport survey, random sample2427.59.8

Look at the sample before estimating anything from it. The median is 25.5 minutes; a few long commutes pull the mean above it.

A 95% confidence interval for a mean is mean ± t* × s / sqrt(n), where t* is the critical value of the t distribution with n − 1 = 23 degrees of freedom, about 2.07.

commute <- read.csv("commute_sample.csv")
t.test(commute$minutes, conf.level = 0.95)$conf.int
# 23.4 to 31.6 minutes

We are 95% confident that the mean commute lies between about 23.4 and 31.6 minutes. That is a statement about the method, not about any one commuter.

Adapted from Statistics for Everyone, chapter 6, by J. Ferris, CC BY 4.0; example data replaced.

An assistant with web search finding openly licensed datasets, reading each licence, and filing the candidates with their sources.

ChatGPT, connected to know.sh

You

Using know.sh, find three openly licensed public datasets for teaching simple linear regression to first-year students: under 500 rows, everyday subjects, a clearly stated licence. File them as a new document called “Datasets for chapter 7” on my Counting on It shelf, one section per dataset.

ChatGPT

I searched the web and read the licence page of each candidate. Two national statistics portals and one city open-data portal had suitable tables; I skipped four whose terms did not allow redistribution.

document_create Created Datasets for chapter 7 on Counting on It

section_add Added “Household energy use and floor area” with 2 sources: the portal page and its licence page

section_add Added “Commute distance and travel time” with 2 sources: the city data portal and its terms of use

section_add Added “Tree height and trunk diameter” with 2 sources: the survey page and its licence

ChatGPT

Each section quotes the licence as the source page states it. Please open the licence pages yourself before you use the data; I cannot confirm licences beyond what those pages say.

Chapter 5 on its public link: the aims, a key to the section types and the licence statement, then the sections. The release checklist is left out.

app.dev.know.sh/share/…, Read only

Chapter 5 — Confidence intervals

Shared from a library on know. 8 sections.

In chapter 4 we saw that sample means vary from sample to sample. This chapter turns that variation into a range of plausible values for a population’s mean or proportion, and says what “95% confident” does and does not mean.

Sections marked Evidence are worked examples, Problem marks a common mistake, and Question marks exercises, with answers in the last section. Formulas are written in plain text in this draft edition.

Counting on It: Introductory Statistics by R. Delgado, Alder Valley Community College, is licensed under CC BY 4.0, except where otherwise noted.

Sections

  1. What a confidence interval estimates (Observation, high importance)
  2. Critical values and the t distribution (Observation, medium importance)
  3. Confidence interval for a mean (Evidence, high importance)
  4. Confidence interval for a proportion (Evidence, high importance)
  5. What 95% confident does not mean (Problem, high importance)
  6. Choosing a sample size (Observation, medium importance)
  7. Exercises (Question, medium importance)
  8. Answers to the exercises (Observation, low importance)

How it works

Write Counting on It a chapter at a time, in the open. Your assistant lays out each chapter from your lecture notes; you write the explanations, run the R and give every section its sources. Each worked example shows its sample as a histogram, mean and median marked, and every chapter goes out on a public link under CC BY.

  1. Lay out a chapter from your notes

    Give your assistant your lecture notes and R scripts for one chapter. Ask for a document with the aims and licence statement in its overview, then a section for each part of the chapter.

  2. Write it into shape

    Press Edit and rewrite each explanation in your voice. Run every R block yourself, write formulas in plain text, and end each adapted passage with its attribution line.

  3. Draw the data from its numbers

    Ask for a histogram element beside each worked example’s table, from the values your R code reads, with the mean and median marked. Check both against what R prints.

  4. Release each chapter on its own link

    Press Share with no expiry and no password, and leave the release checklist out. Students read the draft edition while you write the next chapter.

Try this prompt

Your assistant, connected to know.sh (Claude, ChatGPT or a local model):

Using know.sh, add a histogram element after the table in the section “Confidence interval for a mean” in “Chapter 5 — Confidence intervals” on my Counting on It shelf, from the 24 values in the commute_sample.csv I have attached: bins 5 minutes wide, the mean and median both marked, and a caption naming the survey. Then tell me the mean and median it marks. Change nothing else.

Your assistant, connected to know.sh (Claude, ChatGPT or a local model):

Using know.sh, read “Chapter 5 — Confidence intervals” on my Counting on It shelf. List every section with no source link, every passage that looks adapted but has no attribution line, and every symbol or term used before it is defined. File the list as a new section in that document called “Checks before release” and change nothing else.

Made with

ShelfDocumentSectionYour AI assistantElementsPublic link