Quartis e IQR
Calcula Q1, Q2 (mediana), Q3 e IQR = Q3 − Q1 (método dos percentis lineares).
Q1/Q2/Q3/IQR
—
Quartiles and IQR
Quartiles cut sorted data into four equal parts: Q1 = P25, Q2 = median = P50, Q3 = P75. The interquartile range, IQR = Q3 − Q1, tells you how spread out the central 50% of the data is. There's more than one way to compute it. R type 7 uses linear interpolation and is the default in NumPy and R; Tukey's hinges take the median of each half; and R offers several others, nine in all. For 7, 15, 36, 39, 40, 41, 42, 43, 47, 49 → Q1 ≈ 36.75, Q2 = 40.5, Q3 ≈ 42.75, IQR ≈ 6. Tukey's 5-number summary (1977), which lists min, Q1, median, Q3 and max, gives you a compact picture that holds up against outliers in a way mean ± σ doesn't.
Applications
You'll see this in boxplots during EDA, in outlier detection with the 1.5·IQR fence, and in robust analyses such as reporting median salary alongside the IQR for income variability. It also shows up in descriptive statistics for scientific papers, and really anywhere the mean gets thrown off by extreme values.
FAQ
Why do different tools give different quartiles? Because there are at least 9 valid ways to interpolate quantiles in small samples. NumPy, R and Excel can disagree by a few decimals, though for n ≫ 100 those differences fade away.
IQR or σ for spread? Reach for the IQR when the data is skewed or has outliers. The σ assumes roughly symmetric data and reacts strongly to extremes.
Can the IQR be zero? It can, whenever at least half the observations share the same value (think lots of zeros). That points to highly concentrated data, and isn't necessarily a mistake.
Related Tools
Rent Adjustment Calculator
Compute annual rent adjustment by IGP-M or IPCA accumulated in the last 12 months (manually configurable).
Pregnancy Calculator
Compute estimated due date (EDD), gestational age and trimester from the last menstrual period (LMP).
Fertile Period Calculator
Compute fertile window and ovulation day from the first day of the last cycle and the average cycle length.