Today's lesson
Last week you learned to read a regression table. Today you learn to write it up the way a report would — using the same three numbers you already know how to find.
1 Your site
Before any statistics, open your own site and check it. This is the thing most likely to be half-finished.
If a page does not exist yet, that is today's work — build it first, then come back and do the navigation.
Your portfolio is going to keep growing. After today there is a regression write-up, then a t-test page, then chi-square, then your final report. Every page needs to reach every other page, and you should not have to rebuild the whole site each time you add one.
Two ways to do it, your choice: a row of links across the top, or a menu button that opens them — the hamburger. On a phone the menu button is kinder. Pick one, and use the same one on every page.
I have a portfolio website and I am adding pages to it every week. I do not write code. I want the navigation checked and fixed. I am pasting my current index.html at the bottom of this message. STEP 1 - tell me what I already have. Look at my page and answer these in a short list: - Do I already have a navigation menu? If yes, what kind - a row of links across the top, or a menu button (hamburger)? - Which of these does it link to: index.html, cross-sectional.html, regression.html? - Does it work on a phone screen? STEP 2 - fix only what is missing. - If I already have a menu, KEEP IT. Keep my style, my colors and my layout. Just add whatever links are missing and fix anything broken. - If I have no menu at all, build me one. [CHOOSE ONE] a simple row of links across the top OR a menu button that opens the links. - Either way it must be easy to add more links later - I will add a page roughly every week for the rest of the semester. Put a comment in it showing exactly which line to copy when I add one. STEP 3 - give me the block to paste. Give me the finished navigation as ONE block of HTML with all its styling inside it, so I can paste the same block into every page of my site. Tell me in one sentence where it goes. Then list which of my pages still need it pasted in. Do not rewrite the rest of my page. Do not change my words, my colors or my layout. Do not explain anything beyond what I asked for. Here is my index.html:
Paste your whole index.html underneath the prompt — open it in GitHub, click the pencil, select all, copy. The AI cannot check what it cannot see.
If you already have a menu you like, keep it. The prompt is written to leave your work alone and only add what is missing. If you have no menu yet, choose one of the two options inside the prompt and delete the other.
Then paste the block it gives you into every page, right after <body>, and commit each one.
2 Quick recap
A regression takes two things measured as numbers — a predictor and an outcome — and draws one straight line through all 168 ZIP codes to show whether the outcome goes up or down as the predictor goes up, and by how much.
You use one when you want to know whether one number predicts another. Ours: do ZIP codes with more short sleep also have more distress?
The row name in the table
also called: independent variable
The thing we are using to explain something else.
Listed at the top, next to Dep. Variable
also called: dependent variable
Today, still distress_pct. Every time.
All three come from the predictor's row. Never the Intercept row.
| r | The correlation. Printed above the table, not inside it. Runs −1 to +1. The sign is direction; distance from zero is strength — 0 to 0.3 weak, 0.3 to 0.7 moderate, 0.7 to 1 strong. |
| coef | The slope. How far the outcome moves when the predictor goes up by 1. The steepness of the line. |
| P>|t| | The p-value. Below 0.05 is statistically significant. 0.000 in the output means less than .001. |
r says which way and how tightly. The coefficient says how far. The p-value says whether to believe there is anything there at all.
3 The new piece
In a report nobody writes three sentences. They write one line, and it carries the same three numbers.
Here is last week's no_insurance_pct result, written the way it would appear in a published paper:
r = .65
Your correlation sentence. Positive, and moderate.
b = 0.28
Your slope. In reports the coef number is called b.
p < .001
Your p-value sentence. Significant.
Nothing new has been calculated. The same three numbers, in shorthand.
In a ZIP code, for every 1 percentage point increase in uninsured adults, the distress percentage is a little over a quarter of a percentage point higher.
Concretely: a ZIP code that goes from 10% uninsured to 11% uninsured tends to have a distress percentage about 0.28 points higher.
Each ZIP code has one distress percentage. Nobody's personal distress is being measured here, and nobody's sleep or insurance either.
One wording point that matters all semester: say percentage point, not percent. Distress is already a percentage, so a change in it is measured in percentage points.
4 Together
We do this one together. r = +0.74.
coef — the slopeP>|t| — the p-valuenot today
=============================================================================
Dep. Variable: distress_pct No. Observations: 168
Model: OLS R-squared: 0.546
-----------------------------------------------------------------------------
coef std err t P>|t| [0.025 0.975]
-----------------------------------------------------------------------------
Intercept 10.8653 0.326 33.358 0.000 10.222 11.508
poor_health_pct 0.2172 0.015 14.119 0.000 0.187 0.248
=============================================================================5 Your turn
For each one: the three sentences, then the write-up line.
=============================================================================
Dep. Variable: distress_pct No. Observations: 168
Model: OLS R-squared: 0.217
-----------------------------------------------------------------------------
coef std err t P>|t| [0.025 0.975]
-----------------------------------------------------------------------------
Intercept 12.0700 0.485 24.902 0.000 11.113 13.027
diabetes_pct 0.2678 0.039 6.783 0.000 0.190 0.346
==========================================================================================================================================================
Dep. Variable: distress_pct No. Observations: 168
Model: OLS R-squared: 0.095
-----------------------------------------------------------------------------
coef std err t P>|t| [0.025 0.975]
-----------------------------------------------------------------------------
Intercept 10.4498 1.152 9.070 0.000 8.175 12.725
depression_pct 0.2920 0.070 4.179 0.000 0.154 0.430
=============================================================================Depression and distress are not the same thing. Distress means fourteen or more days of poor mental health in the past thirty days. Depression means a doctor or health professional has at some point told the person they have a depressive disorder. In Table B depression is the predictor, and distress is still the outcome.
Significant does not mean strong. Look at its p-value, then look at its r, and say both out loud.
6 In plain words
Our file is cross-sectional — one snapshot, measured once. So you can say what goes together. You cannot say what caused what.
Notice what that sentence does: it reports the pattern, gives the size in words, says why it matters, and stops short of the claim the data cannot support.
7 Back to your report
Finish regression.html if it is not done
One table — the one you chose last week. Title, screenshot, your three sentences, and two or three plain-language sentences. Linked from your homepage.
Add the write-up line
Underneath your three sentences, add the one-line version: r = ___, b = ___, p = ___. That is today's addition, and it is small.
Make the navigation work
Same menu on every page, so a stranger can move around your site without typing anything.
Optional, if you want the practice: write up any of last week's five tables you did not get to. It is the same three sentences and the same one line, every time.
8 Leaving with this
Three numbers, three sentences, one line. Nothing was added today except the shorthand that every report in your field is written in.