# Parameters Standardization

- Introduction
- How to interpret standardized coefficients?
  - Measure of association (correlation r)
  - Standardized differences

# Introduction

Standardising parameters (i.e., coefficients) can allow for their comparison within and between models, variables and studies. Moreover, as it returns coefficients expressed in terms of change of variance (for instance, coefficients expresed in terms of SD of the response variable), it can allow for the usage of effect size interpretation guidelines, such as the famous Cohen’s (1988) rules of thumb.

However, standardizing the model’s parameters should not be automatically and mindlessly done: for some research fields, particular variables or types of studies (e.g., replications), it sometimes makes more sense to keep, use and interpret the original parameters, especially if they are well known or easily understood.

Critically, parameters standardization is not a trivial process. Different techniques exist, that can lead to drastically different results. Thus, it is critical that the standardization method is explicitly documented and detailed.

`parameters` include different techniques of parameters standardization, described below (Bring 1994; Menard 2004, 2011; Gelman 2008; Schielzeth 2010).

# How to interpret standardized coefficients?

## Measure of association (correlation r)

    library(effectsize)
    library(dplyr)

    lm(Sepal.Length ~ Petal.Length, data = iris) %>%
      standardize_parameters()

Parameter | Std_Coefficient
--- | ---
(Intercept) | 0.00
Petal.Length | 0.87

Standardizing the coefficient of this simple linear regression gives a value of `0.87`, but did you know that for a simple regression this is actually the same as a correlation? Thus, you can eventually apply some (in)famous interpretation guidelines (e.g., Cohen’s rules of thumb).

    library(parameters)

    cor.test(iris$Sepal.Length, iris$Petal.Length) %>%
      model_parameters()

    > Parameter1        |        Parameter2 |    r |     t |  df |      p |       95% CI |  Method
    > --------------------------------------------------------------------------------------------
    > iris$Sepal.Length | iris$Petal.Length | 0.87 | 21.65 | 148 | < .001 | [0.83, 0.91] | Pearson

What happens in the case of multiple continuous variables? As in each effect in a regression model is “adjusted” for the other ones, we might expect coefficients to be somewhat alike to partial correlations. Let’s first start by computing the partial correlation between Sepal.Length and 3 other remaining variables.

    if (require("ppcor")) {
      df <- iris[, 1:4]  # Remove the Species factor
      ppcor::pcor(df)$estimate[2:4, 1]  # Select the rows of interest
    }

    >  Sepal.Width Petal.Length  Petal.Width
    >         0.63         0.72        -0.34

Now, let’s apply another method to obtain effect sizes for frequentist regressions, based on the statistic values. We will convert the t-value (and its degrees of freedom, df) into a partial correlation coefficient r.

    model <- lm(Sepal.Length ~ ., data = df)

    parameters <- model_parameters(model)[2:4,]
    convert_t_to_r(parameters$t, parameters$df_residual)

    > numeric(0)

Wow, the retrieved correlations coefficients from the regression model are exactly the same as the partial correlations!

However, note that in multiple regression standardizing the parameters in not quite the same as computing the (partial) correlation, due to… math :(

    model %>%
      standardize_parameters()

Parameter | Std_Coefficient
--- | ---
(Intercept) | 0.00
Sepal.Width | 0.34
Petal.Length | 1.51
Petal.Width | -0.51

## Standardized differences

How does it work in the case of differences, when factors are entered and differences between a given level and a reference level (the intercept)? You might have heard that it is similar to a Cohen’s d. Well, let’s see.

    lm(Sepal.Length ~ Species, data = iris) %>%
      standardize_parameters()

Parameter | Std_Coefficient
--- | ---
(Intercept) | -1.0
Speciesversicolor | 1.1
Speciesvirginica | 1.9

This linear model suggests that the standardized difference between the versicolor level of Species and the setosa level (the reference level - the intercept) is of 1.12 standard deviation of `Sepal.Length` (because the response variable was standardized, right?). Let’s compute the Cohen’s d between these two levels:

    # Select portion of data containing the two levels of interest
    data <- iris[iris$Species %in% c("setosa", "versicolor"), ]

    cohens_d(Sepal.Length ~ Species, data = data)

    > [1] -2.1

It is very different! Why? How? Both differences should be expressed in terms of SD of the response variable. And there’s the trick. First of all, in the linear model above, the SD by which the difference is scaled is the one of the whole response, which include all the three levels, whereas below, we filtered the data to only include the levels of interest. If we recompute the model on this filtered data, it should be better:

    lm(Sepal.Length ~ Species, data = data) %>%
      standardize_parameters()

Parameter | Std_Coefficient
--- | ---
(Intercept) | -0.72
Speciesversicolor | 1.45

Not really. Why? Because the actual formula to compute a Cohen’s d doesn’t use the simple SD to scale the effect (as it is done when standardizing the parameters), but computes something called the pooled SD. However, this can be turned off by setting `correct = "raw"`.

    cohens_d(Sepal.Length ~ Species, data = data, pooled_sd = FALSE)

    > [1] -1.4

And here we are :)

Bring, Johan. 1994. “How to Standardize Regression Coefficients.” The American Statistician 48 (3): 209–13.

Gelman, Andrew. 2008. “Scaling Regression Inputs by Dividing by Two Standard Deviations.” Statistics in Medicine 27 (15): 2865–73.

Menard, Scott. 2004. “Six Approaches to Calculating Standardized Logistic Regression Coefficients.” The American Statistician 58 (3): 218–23.

———. 2011. “Standards for Standardized Logistic Regression Coefficients.” Social Forces 89 (4): 1409–28.

Schielzeth, Holger. 2010. “Simple Means to Improve the Interpretability of Regression Coefficients.” Methods in Ecology and Evolution 1 (2): 103–13.