Box plot 2026-10-14
A box plot compresses a statistical sample into a box spanning its lower and upper quartiles , a line at its median , and two whiskers. It makes location and central spread easy to compare across groups on a common value axis. The box represents the central half in terms of quantile levels; with ties or interpolated quartiles, it need not contain exactly half the observations. Whisker endpoints require a stated convention: they can be the observed extremes, or they can stop short of separately marked observations. [ref]
Here is one explicitly toy dataset, reused under histogram: twelve invented, unitless values, with repeated values counted separately, already arranged as order statistics:
For this box plot we choose the interpolated quartiles defined under quartile, using R's type-7 rule. This gives
The interquartile range is . Our whisker convention uses the fences
The whiskers end at the smallest and largest observations in the closed interval : here and . Values strictly outside the fences receive separate outlier markers: here only . An observation exactly on a fence is retained within the whisker under this convention. The fences are thresholds, not observed whisker endpoints; the upper whisker is at , not . R's documented whisker rule likewise includes observations no more than box lengths away, although its box uses hinges, which can differ from our type-7 quartiles. [ref]
Figure 1.
Toy box plot: quartiles define the box, observations define the whiskers
. The twelve invented values are shown individually below the box plot, with repeated values stacked. Type-7 quartiles are ; the interquartile range is . Dashed fences at and determine whiskers at and and a separate marker at . The fence lines and raw-value strip are explanatory additions, not required parts of every box plot. Details.
A separate outlier marker is a prompt to investigate, not a finding that the value is bad data and not an instruction to delete it. A distant observation can be a recording error, a legitimate unusual outcome, or evidence that the assumed statistical model misses some behavior. Check its provenance and context before deciding how to analyze it. No measurement-error claim is possible for our invented : we deliberately put it there to demonstrate the rule. [ref]
The beauty of a box plot is its compact comparison of ordered positions rather than every observation. That compression also loses information: many different statistical samples have the same quartiles and whiskers, so the box alone cannot reveal every cluster or gap that a histogram might show. For example, replacing the two invented values by and leaves the type-7 quartiles, whiskers and separate marker unchanged. Displaying the individual values alongside the box plot is especially helpful for such a small statistical sample. Always state both the quartile rule and the whisker rule; changing either can change which values are marked.
Interquartile range 2026-10-14
The interquartile range measures the width between the lower and upper quartiles, in the same units as the observations. It describes central spread rather than the distance between the observed extremes. In our toy box plot, ; moving the largest value from to would leave the quartiles and interquartile range unchanged under the chosen rule, because the order statistics used in their interpolation would not change.
The printed group means suggest about 13.49 more tweets in the liberal group, but the reported significance cannot be accepted as one coherent test result. The printed would reject equal means at 5%; the printed with 23.92 statistical degrees of freedom instead gives a two-sided p-value about 0.06380 and would not reject at 5%. The confidence-interval fields are also inconsistent.
There are 14 conservative-coded and 12 liberal-coded observations. The tweet summary has sample median 258.5, quartiles 204.5 and 323.2, and range 108 to 441, so the interquartile range is about 118.7 tweets. No measurement period is specified, so these should not be reinterpreted as tweets per day. The displayed overall sample mean is 261.5, subject to a further consistency issue below. These are small groups; the summary alone cannot establish normality, lack of outliers or an appropriate sampling design.
Let and be the two population means for the defined tweet measure. The null hypothesis is , against the two-sided test alternative . Welch's t-test uses
allowing unequal group variances. It requires independent observations and a suitable approximation to the sampling distribution of the mean difference; a large-sample justification cannot simply be assumed with group sizes 14 and 12. Its noninteger statistical degrees of freedom comes from the Welch approximation, not a fractional number of respondents.[ref]
The two displayed sample means imply
The negative sign means the liberal-coded group has the larger observed mean. This is a difference in group averages, not a statement about every individual and not evidence that political orientation causes tweeting behaviour. Practical importance concerns this difference and its context; statistical significance does not itself measure its importance.
A p-value is calculated under the null hypothesis and the assumed sampling model. It is the probability of a result at least as incompatible with that hypothesis as the observed one, not the probability that the hypothesis is true or that this conclusion is mistaken. A prespecified significance level controls the long-run Type I error rate of rejecting a true null; a Type II error is nonrejection of a false null, and statistical power concerns rejection under a specified alternative. Neither a small p-value nor a nonrejection settles the effect size or a causal explanation.
Taken on its own, the printed p-value supports a nominal 5% rejection, but not a 1% rejection. Taken instead from the printed t statistic and statistical degrees of freedom, the two-sided tail is about 0.06380. These different 5% decisions cannot be reconciled by ordinary rounding. Conditional on trusting the group means, t and degrees of freedom, the implied standard error is and the corresponding 95% confidence interval is
It includes zero, consistently with that larger p-value. This calculation is a conditional consistency check, not recovery of the true raw-data interval.
The source lists its interval endpoints as 0.04582 and , in that order. They are not ordered, and merely sorting them would still give midpoint about , rather than the estimated difference . The symmetric confidence-interval consistency identities therefore fail for the usual t interval. A frequentist 95% interval describes repeated-sample coverage of its procedure, not a 95% posterior probability for a fixed parameter; neither interpretation justifies silently repairing these endpoints.
The group summaries also imply pooled mean , which cannot round to the printed 261.5. The pooled-mean compatibility under rounding identifies this additional mismatch for summaries of the same complete sample. Thus the observed direction is conditionally liberal-greater-than-conservative, but the inferential decision and interval require corrected coherent output. Nonrejection under the t/df reading would not establish equal population means. Random assignment, representativeness and possible confounding are not supplied by this test.
Conditional on the printed two-group test output, the male-coded group has higher mean efficacy by about 1.034 scale points, with a 95% confidence interval of about 0.785 to 1.282 points. This is strong evidence against equal population means under the test's assumptions. It does not establish a causal effect, and the accompanying overall mean is inconsistent with the group summaries.
Here the coding identifies group 0 as male and group 1 as female in this dataset. The counts are 1215 and 1251, respectively, or approximately 49.27% and 50.73% of 2466 observations. These are sample compositions, not evidence that the sample represents every population of interest. The continuous efficacy scale runs from 0 to 16, with higher scores indicating stronger efficacy. Its printed sample median is 10 and its quartiles are 8 and 12, so its interquartile range is 4 points. The printed overall sample mean, 9.348, requires the separate consistency qualification below.
Let and denote the two population means. The null hypothesis is , and the alternative hypothesis is the two-sided test . The two sample means give
The positive sign means higher mean efficacy in group 0, given this coding; it does not say that every member of that group has higher efficacy than every member of group 1.
Welch's t-test estimates uncertainty from the two groups separately rather than assuming equal population variances:
The printed implies a standard error of approximately points. The noninteger 2277.4 statistical degrees of freedom comes from the Welch approximation; it is not a count of fractional observations. Using the corresponding Student t-distribution gives the displayed p-value, approximately . The test and interval calculations agree to the precision of the printed numbers.[ref]
A p-value is the probability, under the null hypothesis and the assumed sampling model, of a test result at least as incompatible with equal means as the observed result. It is not the probability that the null hypothesis is true, the probability that the finding is a chance mistake, or the size of the mean difference. At a prespecified significance level such as , this result rejects the equal-mean null hypothesis; it also rejects at 1%. A Type I error is rejection when that hypothesis is true, and a valid level- procedure controls its long-run probability. A Type II error is failure to reject a false hypothesis; statistical power is the probability of rejection under a specified alternative. Neither error probability for this one realized claim is supplied by its p-value.
The 95% confidence interval comes from , with critical value about 1.961. Its positive endpoints support the same direction and exclude zero. The frequentist 95% statement concerns coverage over repeated samples, not a 95% posterior probability assigned to this fixed interval. Reporting the difference in scale points supplies an effect size; its practical importance also depends on what a point means substantively. A very small p-value alone does not answer that question.
The inferential calculation requires independent observations and an appropriate sampling model. With these large groups, approximately normal sampling distributions of the means can be more plausible than normality of individual bounded scores, but a large sample size does not correct dependence, clustering, selection bias or measurement problems. The output does not establish random assignment or remove possible confounding, so the estimated difference is an association.
There is a material source inconsistency. For exhaustive groups with complete outcome data, the sample mean must be the sample-size-weighted mean of the group means:
which cannot round to 9.348. Figure 7 independently reports all 2466 efficacy values present and again gives 9.348; Question 6 refers back to the same continuous scale. The pooled-mean compatibility under rounding rules out explaining the discrepancy by the displayed decimal precision. Thus the two-group test supports the stated conclusion if its own group summaries and test fields are trusted, while the overall mean cannot simultaneously be accepted as a coherent summary of those groups. No unprinted exclusion or uniquely correct replacement mean is established.
Taken at face value, the printed two-sided p-value rejects equality of average political efficacy at the 5% level, with the non-employed group scoring higher. The effect magnitude and strength of evidence cannot be reported as one coherent result because the estimates, interval, test statistic and p-value contradict one another.
Let and be the expected political efficacy scores in the two employment groups in the target population. The null hypothesis is and the two-sided alternative hypothesis is . A Welch's t-test compares the difference of sample means with its standard error, estimating the two group variances separately:
The reference Student t-distribution has approximate, generally noninteger statistical degrees of freedom; it does not require equality of the two variances. Observations should be independent, with finite group variances; normal distributions give the usual small-sample rationale, while large samples permit an approximate normal sampling distribution under suitable conditions. A large sample cannot correct a biased sampling procedure or dependence between observations.[ref]
A p-value is a probability calculated under the null hypothesis and the sampling assumptions: for this two-sided test it measures the probability of an absolute test statistic at least as large as the observed one. It is not the probability that the null hypothesis is true, the probability that chance caused the observed difference, or a measure of the effect size. If the significance level was chosen in advance, the printed falls just below it. This would reject at 5%, but not at 1%. The significance level describes the long-run probability of a type I error, rejecting a true null hypothesis; a type II error instead fails to reject a false null hypothesis. Statistical power is the rejection probability under a specified alternative hypothesis. None of these errors for this particular realised study can be read as a posterior probability from .
Both the printed sample means and the positive confidence interval point toward greater political efficacy in group 0, the non-employed group. Their magnitudes disagree. Subtracting the printed sample means gives scale units. Yet the printed 95% confidence interval has midpoint , not . A two-sided Welch interval is centred on the difference of sample means. This violates the consistency identities for a two-sided t-test; the interval and estimates cannot describe the same reported comparison. If the interval alone were trusted, it would exclude zero and indicate an increase between about and units, but that is explicitly a conditional interpretation. A 95% confidence interval refers to repeated-sample coverage of a fixed statistical parameter, not a 95% posterior probability for that realised interval.[ref]
There are additional arithmetic warnings. The printed at statistical degrees of freedom gives a two-sided p-value about , not . Thus taking the test statistic as authoritative would imply much stronger evidence, not merely a marginal 5% result. The employment counts sum to , but their percentages are and , not and . If those counts also apply to the two political efficacy sample means, their weighted arithmetic mean would be about , not the reported overall ; separate complete-case group sizes are not supplied, so that last cross-output comparison is conditional on a common sample. No uniquely corrected difference, standard error or interval follows from these contradictory fields.
The political efficacy summary describes a bounded observed scale from to , with median and middle quartiles and . The interquartile range is ; the overall sample mean being below the median does not, by itself, establish a particular distributional shape. These descriptive statistics cannot supply the missing coherent group variances or a standardized effect size. Even a corrected small p-value would establish an association under a statistical model, rather than a causal effect of employment. Age, other background covariates, selection bias and the quality of the political efficacy measurement remain relevant. A defensible report gives the conditional 5% decision and direction, identifies the contradictions, and withholds a single numerical effect-and-uncertainty claim until the output is checked.