Giter VIP home page Giter VIP logo

Comments (8)

mattansb avatar mattansb commented on June 9, 2024

For GLMs, the response is not standardized.
The default standardization method (refit) does not standardize factors.

Therefore, in this model, nothing is standardized.

from report.

ludi94 avatar ludi94 commented on June 9, 2024

Thank you very much for your fast response and the clarification!
Do you know if this is just not implemented or is it more critical to standardize factors in glms compared to lms?

Again, thank you very much!

from report.

mattansb avatar mattansb commented on June 9, 2024

It is not implemented by design: there is no way to "standardize" a non-numeric variable.

parameters::model_parameters() has standardize = "basic" method that standardizes the coefficients by the design matrix. But i don't see that this is implemented here yet, @rempsyc ?

from report.

ludi94 avatar ludi94 commented on June 9, 2024

I am just wondering why i get std. values when i use the same data but fitting a lm instead of glm:
modell <- lm(anzahl_unfaelle ~ wetter, data = daten)
report(modell)

from report.

mattansb avatar mattansb commented on June 9, 2024

Because for gaussian models, the response is standardized.
For GLMs it does not make sense to standardize the response - the scale is not arbitrary, and changing it will qualitatively change the model, and often will just make the model not work (which is not true for gaussian models).

from report.

ludi94 avatar ludi94 commented on June 9, 2024

I see! Thanks a lot!

from report.

strengejacke avatar strengejacke commented on June 9, 2024

It's not super easy to find, but you can obtain results from different standardization methods using parameters::standardize_parameters():

library(easystats)
#> # Attaching packages: easystats 0.7.0
#> ✔ bayestestR  0.13.1.7     ✔ correlation 0.8.4.9000
#> ✔ datawizard  0.9.0.2      ✔ effectsize  0.8.6.3   
#> ✔ insight     0.19.6.7     ✔ modelbased  0.8.6.4   
#> ✔ performance 0.10.8.1     ✔ parameters  0.21.3.1  
#> ✔ report      0.5.7.13     ✔ see         0.8.1

set.seed(123)
anzahl_unfaelle <- rpois(100, lambda = 3)  # Lambda ist der erwartete Wert
mean(anzahl_unfaelle)
#> [1] 2.94
var(anzahl_unfaelle)
#> [1] 2.622626

wetter <- factor(sample(c("regnerisch", "bewölkt", "sonnig"), 100, replace = TRUE))
daten <- data.frame(anzahl_unfaelle, wetter)

modell <- glm(anzahl_unfaelle ~ wetter, data = daten, family = "poisson")
standardize_parameters(modell, method = "basic")
#> # Standardization method: basic
#> 
#> Parameter        | Std. Coef. |        95% CI
#> ---------------------------------------------
#> (Intercept)      |       0.00 | [ 0.00, 0.00]
#> wetterregnerisch |   1.96e-03 | [-0.13, 0.13]
#> wettersonnig     |       0.03 | [-0.10, 0.16]
#> 
#> - Response is unstandardized.

See also the docs here:
https://easystats.github.io/parameters/reference/standardize_parameters.html

from report.

rempsyc avatar rempsyc commented on June 9, 2024

parameters::model_parameters() has standardize = "basic" method that standardizes the coefficients by the design matrix. But i don't see that this is implemented here yet, @rempsyc ?

Not AFAIK

from report.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.