BM21 Business Analytics · Module 2
Descriptive statistics, sampling and correlation
Erasmus RSM
Formulas (formula sheet or know them)
- CI = x-bar +/- z* x SE or t* x s / sqrt(n) (formula sheet). SE = s / sqrt(n)
- z* = 1.64 (90%), 1.96 (95%), 2.58 (99%): know them
- Cov = sum (x - x-bar)(y - y-bar) / (n - 1); r = Cov / (sd(X) x sd(Y)) (formula sheet)
- Partial correlation: r_XY.Z = (r_XY - r_XZ x r_YZ) / sqrt((1 - r_XZ^2)(1 - r_YZ^2))
- Outlier fences: Q3 + 1.5 x IQR and Q1 - 1.5 x IQR; |Z| > 2 stands out
Design, sampling and biases
- Internal validity: is it right within the source population. External validity: generalise to the target population
- Sampling: simple random; stratified (from every group); systematic (step N / n); cluster (a few whole groups)
- Selection bias (design), non-response bias (dropouts), response bias (answer is not behaviour). A larger n shrinks chance, not bias (1936: 2.3 million answers)
Reading R output
- pnorm = left tail; right = 1 - pnorm(). qnorm(0.975) = 1.960. Two-sided p = 2 x (1 - pt(abs(t), df))
- summary(pCool): mean 10.12 > median 9.08, max 83.1: right-skewed
- cor.test (energy, n = 211): r = 0.086, t = 1.242, df = 209 (n = df + 2), p = 0.2156, interval [-0.050; 0.218] contains 0: H0 not rejected, no proof of no relationship
- Without 2 outliers: r = 0.138, p = 0.047. Always look at the scatter plot
- Significant needs |r| > 0.135 at n = 211, but > 0.396 at n = 25
- Covariance 6.64 depends on units
Pitfalls of Pearson
- An outlier distorts r. r = 0 is no linear relationship: y = x^2 (x from -10 to 10) gives r = 0
- Rising but not straight: Spearman (ranks)
- p is certainty, r is strength: r = 0.3 with p < 0.001 is certain but weak
Correlation is not causation
- Explanations: A causes B, B causes A (reverse causality), chance, feed-forward, confounder
- Spurious correlation: ice cream sales and drownings via temperature; check with partial correlation
- Causal = X changes, Y changes, rest constant (ceteris paribus). Independent: P(Y) = P(Y | X)
Decision rules
- Central limit theorem: the sample mean is approximately normal with sd = standard error, from n = 20 to 30. Not the data
- Higher level: wider CI. Halve SE: 4 x n. The 95% belongs to the method
- Histogram: one variable. Scatter plot: two numbers. Box plot: number per category
Key terms (never translate)
simple random samplingstratified samplingsystematic samplingcluster samplingselection biasnon-response biasresponse biastarget populationsource populationrepresentativitysampling errorpoint estimatorinterval estimatorcovariancepartial correlationspurious correlationsamplingpopulationsamplesample sizesample meanvalidityinternal validityexternal validityinferencesampling variationsampling distributioncentral limit theoremstandard errorconfidence intervalconfidence levelassociationcorrelationPearsonSpearmanlinear dependencycorrelation is not causationstatistical dependencystatistical independencejoint distributionmarginal distributionconditional distribution