You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Use `print()` or `cat()` to display intermediate values for debugging.
388
388
- Do not use `print()` in return statements of functions, just use `return(return_object)`.
389
+
390
+
## QQ Plot and Normality Test
391
+
392
+
### Quantile
393
+
394
+
A quantile is a value that divides a dataset into intervals containing equal proportions of the data.
395
+
396
+
Sort the given data from smallest to largest, a quantile tells you the value below which a certain percentage of the data falls. For example, the 25th percentile (or first quartile) is the value below which 25% of the data falls.
397
+
398
+
For a dataset of size `n`, the `p`-th quantile is roughly the value at the position `p * (n - 1) + 1` in the sorted data. If this position is not an integer, you can interpolate between the two nearest values.
399
+
400
+
If the data is normally distributed, the points in a QQ plot will approximately lie on a straight line. Deviations from this line indicate departures from normality.
401
+
402
+
### QQ Plot
403
+
404
+
A QQ plot (quantile-quantile plot) is a graphical tool to assess if a dataset follows a particular distribution, such as the normal distribution (most commonly seen). It plots the quantiles of the dataset against the quantiles of the theoretical distribution.
405
+
406
+
A Q–Q plot is straight because quantiles transform linearly under affine transformations, and the plot is literally visualizing that relationship.
0 commit comments