... | @@ -14,20 +14,20 @@ R² is a useful metric for assessing how well a model explains the relationship |
... | @@ -14,20 +14,20 @@ R² is a useful metric for assessing how well a model explains the relationship |
|
R² is calculated by comparing the total variation in the response variable to the variation explained by the model. The formula is:
|
|
R² is calculated by comparing the total variation in the response variable to the variation explained by the model. The formula is:
|
|
|
|
|
|
$$
|
|
$$
|
|
R^2 = 1 - \frac{SS_{\text{residual}}}{SS_{\text{total}}}
|
|
R^2 = 1 - \frac{SSE}{SST}
|
|
$$
|
|
$$
|
|
|
|
|
|
Where:
|
|
Where:
|
|
- **SS_residual** is the sum of squared differences between the observed values $y_i$ and the values predicted by the model $\hat{y}_i$ (i.e., the residuals).
|
|
- **SSE** (Residual Sum of Squares) is the sum of squared differences between the observed values $y_i$ and the predicted values $\hat{y}_i$:
|
|
|
|
|
|
$$
|
|
$$
|
|
SS_{\text{residual}} = \sum_{i=1}^{n} (y_i - \hat{y}_i)^2
|
|
SSE = \sum_{i=1}^{n} (y_i - \hat{y}_i)^2
|
|
$$
|
|
$$
|
|
|
|
|
|
- **SS_total** is the total sum of squared differences between the observed values $y_i$ and the mean of the response variable $\bar{y}$.
|
|
- **SST** (Total Sum of Squares) is the total sum of squared differences between the observed values $y_i$ and the mean of the response variable $\bar{y}$:
|
|
|
|
|
|
$$
|
|
$$
|
|
SS_{\text{total}} = \sum_{i=1}^{n} (y_i - \bar{y})^2
|
|
SST = \sum_{i=1}^{n} (y_i - \bar{y})^2
|
|
$$
|
|
$$
|
|
|
|
|
|
In short, $R^2$ tells you how much of the variability in the response variable is captured by the model.
|
|
In short, $R^2$ tells you how much of the variability in the response variable is captured by the model.
|
... | @@ -110,8 +110,8 @@ R^2_{\text{McFadden}} = 1 - \frac{\ln(L_{\text{full model}})}{\ln(L_{\text{null |
... | @@ -110,8 +110,8 @@ R^2_{\text{McFadden}} = 1 - \frac{\ln(L_{\text{full model}})}{\ln(L_{\text{null |
|
$$
|
|
$$
|
|
|
|
|
|
Where:
|
|
Where:
|
|
- \(L_{\text{full model}}\) is the likelihood of the fitted model.
|
|
- $L_{\text{full model}}$ is the likelihood of the fitted model.
|
|
- \(L_{\text{null model}}\) is the likelihood of the null model (a model with only an intercept).
|
|
- $L_{\text{null model}}$ is the likelihood of the null model (a model with only an intercept).
|
|
|
|
|
|
#### Cox & Snell's Pseudo-R²
|
|
#### Cox & Snell's Pseudo-R²
|
|
|
|
|
... | @@ -121,7 +121,7 @@ $$ |
... | @@ -121,7 +121,7 @@ $$ |
|
R^2_{\text{Cox-Snell}} = 1 - \left( \frac{L_{\text{null model}}}{L_{\text{full model}}} \right)^{2/n}
|
|
R^2_{\text{Cox-Snell}} = 1 - \left( \frac{L_{\text{null model}}}{L_{\text{full model}}} \right)^{2/n}
|
|
$$
|
|
$$
|
|
|
|
|
|
Where \(n\) is the number of observations.
|
|
Where $n$ is the number of observations.
|
|
|
|
|
|
#### Nagelkerke's Pseudo-R²
|
|
#### Nagelkerke's Pseudo-R²
|
|
|
|
|
... | | ... | |