Comments (2)
tab_model()
relies on performance::performance_aic()
to get the AIC. That function returns a corrected AIC for transformed response-values, which is more accurate, since the underlying "variation" in the data should be similar if the raw data is the same. See example and links to docs:
m <- c(5000, 360)
s <- c(2000, 50)
r <- -0.75
sigma <- sqrt(log(s^2/m^2 + 1))
mu <- log(m) - sigma^2/2
rho <- log(r*prod(s)/prod(m) + 1)
# Random data generation
library(MASS)
n <- 50
set.seed(2)
dados <- exp(mvrnorm(n = n, mu = mu, Sigma = diag(sigma^2 - rho) + rho,
empirical = TRUE))
colnames(dados) <- c("PU", "Area")
dados <- as.data.frame(dados)
# Wrong fit:
wfit <- lm(PU ~ Area, data = dados)
# Good fit:
fit <- lm(log(PU)~log(Area), data = dados)
# comparable results
performance::performance_aic(wfit)
#> [1] 863.5921
performance::performance_aic(fit)
#> [1] 844.8888
see ?performance::performance_aic
:
performance_aic()
correctly detects transformed response and, unlikestats::AIC()
, returns the "corrected" AIC value on the original scale. To get back to the original scale, the likelihood of the model is multiplied by the Jacobian/derivative of the transformation.
See also https://easystats.github.io/performance/reference/performance_aicc.html and https://easystats.github.io/insight/reference/get_loglikelihood.html (argument check_response
).
from sjplot.
Perfect, @strengejacke! Although I think you should use different argument names (just suggesting), like show_adj_aic
and show_aic
. Then it would be clear to the user of your package what's happening behind the courtains. Thanks a lot!
from sjplot.
Related Issues (20)
- support for a quantile regression
- factor level labels not corresponding
- questions about *, ** and ***
- "Model has log-transformed response. Back-transforming predictions to original response scale. Standard errors are still on the log-scale." - solution? HOT 1
- `tab_model` not working with large `rlmerMod` model with compositional data
- Site Not Found HOT 1
- Plotting three-way interactions without panels?
- Confidence interval bands partially or completely disappear when axes rescaled
- Discrepancy between plot_model output and estimate from lmer summary #424 HOT 2
- Discrepancy between summary() and tab_model() for brms models HOT 5
- I installed the sjPlot package successfully but when I opened it with library I got that it called the estimability package HOT 5
- Problem with sjPlot HOT 2
- Couldn't report residual standard errors of lm object
- Enabling weights column in sjplot data selection
- plot_model type = "int" errors when scale() is included in model formula HOT 1
- Using tab_corr in an .rmd file
- Are signifcane asterisks reliable when using robust linear models (rlm) in combination with estimate plots (plot_model)? HOT 3
- Backtransformation of sqrt() transformed estimates using plot_model() HOT 3
- tab_model displaying incorrect estimates with glm() objects HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sjplot.