📋 RESUM: Regressió lineal
**Model simple:** Y_i = β₀ + β₁ x_i + ε_i, amb E[ε_i]=0, Var(ε_i)=σ² (i sovint normalitat).
**Mínims quadrats (OLS):** minimitza S=∑(y_i−b₀−b₁x_i)².
Fórmules:
• b₁ = S_xy / S_xx, on S_xx=∑(x_i−x̄)² i S_xy=∑(x_i−x̄)(y_i−ȳ)
• b₀ = ȳ − b₁ x̄
La recta passa per (x̄,ȳ) i ∑e_i=0.
**Variabilitat:** SST=∑(y_i−ȳ)² = SSR + SSE, amb SSE=∑e_i².
**R²:** R²=SSR/SST=1−SSE/SST (en regressió simple, R²=r²).
**Inferència (errors normals):** s²=SSE/(n−2).
Contrast H₀:β₁=0: T=b₁/(s/√S_xx) ~ t_{n−2}.
IC β₁: b₁ ± t_{α/2,n−2}·s/√S_xx.
**Predicció:** IC per la mitjana a x₀ i interval de predicció (més ample) amb termes 1/n i (x₀−x̄)²/S_xx.
**Diagnòstic:** residus (no linealitat, heterocedasticitat), punts influents (Cook), i en regressió múltiple, multicol·linealitat (VIF).