easystats / report

:scroll: :tada: Automated reporting of objects in R
https://easystats.github.io/report/
Other
695 stars 69 forks source link

Eff size and missing data on report for lmer #29

Closed atnplab closed 5 years ago

atnplab commented 5 years ago

I cannot find eff.size for lmer object with report even if specified in the formula. How can I get this?

Additionaly I found missing values in the text due to a bug I think ;)

Many thanks!

fit2 <- lmer(Own~ Condition Time Iaw_tot + (1|Soggetti), data = df1) r <- report(fit2, effsize = "cohen1988") to_fulltext(r) We fitted a linear mixed model to predict Own with Condition, Time and Iaw_tot (formula = Own ~ Condition Time Iaw_tot). The model included Soggetti as random effects (formula = ~1 | Soggetti). Effect sizes were labelled following Cohen's (1988) recommendations. The model's intercept, corresponding to Condition = , Time = and Iaw_tot = 0, is at (t() = 6.24, 95% CI [-3.23, 9.97], p < .001).

Within this model:

DominiqueMakowski commented 5 years ago

Hi @atnplab and welcome to github!

The reason for the missing text issue is because we are in the process of changing the underlying packages supporting report. In particular, it relies on the parameters package to get values for parameters, and we recently changed the column name, previously named beta to Coefficient, hence report doesn't find it and leaves empty text.

We will be fixing report soon, once the parameters package will be available on CRAN.

As for your initial question about the effect size (in that case, the standardized coefficients), you can still access them using directly the parameters package and its model_parameters function.

Note that pretty much every value reported by report is drawn from model_parameters and model_performance (available in the performance package). You can get the values directly from there, while we fix their nice reporting. cheers!

gorkang commented 5 years ago

I was about to open a new issue, but after reading this, I imagine some of the missing info when reporting lm's and others have to do with the renaming you are doing (?)

Just in case, when reporting lm's we miss the intercept info:

model_lm <- lm(Sepal.Length ~ Petal.Length * Petal.Width, data = iris)
report(model_lm)

We fitted a linear model to predict Sepal.Length with Petal.Length and Petal.Width. The model's explanatory power is substantial (R2 = 0.81, adj. R2 = 0.80). The model's intercept is at .

Also, here we miss the F, p, intercept:

model_lm <- lm(Sepal.Length ~ Petal.Length * Petal.Width, data = iris)
report(model_lm) %>% to_fulltext()

We fitted a linear model (using OLS algorithm) to predict Sepal.Length with Petal.Length and Petal.Width (formula = Sepal.Length ~ Petal.Length * Petal.Width). Effect sizes were labelled following Cohen's (1988) recommendations. The model explains a not significant and substantial proportion of variance (R2 = 0.81, F(, ) = , p , adj. R2 = 0.80). The model's intercept, corresponding to Petal.Length = 0 and Petal.Width = 0, is at (t(146) = 40.89, 95% CI [4.36, 4.80], p < .001).

Cheers

DominiqueMakowski commented 5 years ago

@atnplab @gorkang Just to let you know that the package has (finally) been fixed (in theory)! You will need the latest github versions of parameters and performance:

devtools::install_github("easystats/performance")
devtools::install_github("easystats/parameters")
devtools::install_github("easystats/report")

Please do give it a try and give us a feedback (and let us know if you're interested in contributing somehow) ☺️ Thanks a lot!

atnplab commented 5 years ago

Hello everyone,

Many thanks for your feedback! Actually I have some issues on these updates which also concern rstanarm.

devtools::install_github("easystats/performance") Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : there is no package called ‘processx’ Error in gzfile(file, mode) : cannot open the connection In addition: Warning message: In gzfile(file, mode) : cannot open compressed file 'C:\Users\pietr\AppData\Local\Temp\Rtmp4mHJMN/libloc_193_65aa20ab.rds', probable reason 'No such file or directory' devtools::install_github("easystats/parameters") Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : there is no package called ‘processx’ Error in gzfile(file, mode) : cannot open the connection In addition: Warning message: In gzfile(file, mode) : cannot open compressed file 'C:\Users\pietr\AppData\Local\Temp\Rtmp4mHJMN/libloc_193_65aa20ab.rds', probable reason 'No such file or directory' devtools::install_github("easystats/report") Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : there is no package called ‘processx’ Error in gzfile(file, mode) : cannot open the connection In addition: Warning message: In gzfile(file, mode) : cannot open compressed file 'C:\Users\pietr\AppData\Local\Temp\Rtmp4mHJMN/libloc_193_65aa20ab.rds', probable reason 'No such file or directory' library(rstanarm) Error: package or namespace load failed for ‘rstanarm’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]): there is no package called ‘processx’ In addition: Warning message: package ‘rstanarm’ was built under R version 3.5.3

Any suggestions?

Cheers!