Read and reuse the APA sentence
Take apart the line in italics on every result card, learn the conventions behind it, switch style when a journal asks, and copy it instead of retyping.
What runs in CodeSplash
- Two-sample t-test (Welch / Student, or z test) Verified in Python and R
- Paired t-test Verified in Python and R
You will be able to
- Read each piece of an APA results line
- Apply the p-value and leading-zero conventions
- Switch p-value style and reuse the sentence without retyping
Read first
The line in italics
ReadUnder the summary on most result cards sits a line in italics. It's written in APA styleAPA styleThe American Psychological Association's conventions for reporting statistics, used by many journals and reports., the convention many journals and reports use for statistics.
Welch's t(55.31) = 1.92, p = .061, g = 0.49, 95% CI [−0.02, 0.99]
The reporting engine writes it from the engine's numbers, so it can't drift from the result.
Piece by piece
Read| Piece | What it says | Convention |
|---|---|---|
| t(55.31) | The statistic and its degrees of freedomDegrees of freedomHow much independent information is left to estimate variability after fitting the model. | Whole-number df stay whole. Welch's get two decimals |
| = 1.92 | How far the result sits from the null | Two decimals |
| p = .061 | The evidence | Exact, three decimals, no leading zero |
| g = 0.49 | The effect sizeHedges' gThe mean difference divided by the pooled SD, multiplied by a small-sample correction J that removes Cohen's d's upward bias. | Leading zero, since it can exceed 1 |
| 95% CI [ , ] | The interval for the effect size | The level, then the limits in brackets |
Which interval is right?
PredictPredict first
This card's summary gives 95% CI [−0.17, 7.57]. Its APA line gives [−0.02, 0.99]. Which is right?
Reveal
Both. The first is for the raw difference in means, in the outcome's own units. The second is for Hedges' g, in standard deviations. When you quote an interval, make it clear which estimate it belongs to.
Small p-values and leading zeros
ReadTwo rules cover most of what people get wrong.
- p-values: give the exact value down to three decimals. Below that, write
p < .001, neverp = .000, because a p-value is never zero. - Leading zeros: leave off the zero for anything that can't exceed 1 in size, such as
p,randR². Keep it for anything that can, such ast,dandg.
The card applies both for you. You need them when you read other people's work, and when you write numbers by hand.
Other journals, other styles
In the appNot every venue wants APA. Open the t test, run it on len by supp, then open Reporting settings on the card.
The same p-value under p-value style:
- APA: p = .061
- NEJM: P = 0.06
- GraphPad: p = 0.0606
Nothing reruns. A report has its own setting under Report settings, so one report can differ from the project.
Copy it, don't retype it
ExploreEach number in the sentence is tagged with where it came from. Hover over one on the card: it names the result value behind it.
Now press the copy button beside the line and paste it into a note. Better still, save the analysis and press Add to report, so the sentence comes with the result and follows the report's settings.
Retyping is how two digits get swapped in a p-value. A number nobody typed can't have that kind of typo.
Same pattern, other tests
ReadOther tests use the same frame with different symbols. Here is a paired t test on extra sleep from two drugs:
t(9) = −4.06, p = .003, g_z = −1.17, 95% CI [−1.94, −0.38]
The df is a whole number and there's no "Welch's". The effect size is g_z, because it's standardized by the SD of the paired differences.
Do it in code
ExploreOutside the app, write the rule once. Try this with a p-value of 0.0004.
def apa_p(p):
if p < 0.001:
return "p < .001"
return f"p = {p:.3f}".replace("0.", ".", 1)
print(apa_p(0.0606), apa_p(0.0004))apa_p <- function(p) {
if (p < 0.001) return("p < .001")
sub("0\\.", ".", sprintf("p = %.3f", p))
}
c(apa_p(0.0606), apa_p(0.0004))Check your understanding
CheckpointCheck yourself
A test returns p = 0.00042. How does APA style write it?
Show the answer
Answer: c
Exact to three decimals, and anything smaller becomes "< .001". "p = .000" would claim something impossible.
Check yourself
Which of these follows the leading-zero rule?
Show the answer
Answer: a
A correlation can't exceed 1 in size, so it drops the zero. Cohen's d can, so it keeps it.
Check yourself
Put these in the order an APA results line uses.
Show the answer
The order:
- The statistic with its degrees of freedom
- The exact p-value
- The effect size
- The interval for the effect size
Statistic, evidence, size, precision. It's the same order for nearly every test on the card.
Your style
ReflectWhere will your next result go? Find out which style that place expects and set it once in Reporting settings, so you don't have to think about it again.
Recap
Recap- The APA line gives the statistic, the exact p-value, the effect size and its interval.
- Write
p < .001, neverp = .000, and drop the leading zero only for values that can't exceed 1. - Change style in settings, and copy or add to a report so that you never retype a number.
Concepts in this lesson