Closed IsadoraBM closed 4 years ago
Hmm, I actually can't reproduce this error:
set.seed(123)
library(ggstatsplot)
library(rms)
## Dobson (1990) Page 93: Randomized Controlled Trial :
counts <- c(18,17,15,20,10,20,25,13,12)
outcome <- gl(3,1,9)
treatment <- gl(3,3)
f <- glm(counts ~ outcome + treatment, family=poisson())
ggstatsplot::ggcoefstats(f)
Created on 2020-10-09 by the reprex package (v0.3.0)
As for the second issue, I would prefer not to support specifying exactly which predictors to show. This is at any case easier for the user to do. There are two options:
set.seed(123)
library(tidyverse)
library(rms)
## Dobson (1990) Page 93: Randomized Controlled Trial :
counts <- c(18, 17, 15, 20, 10, 20, 25, 13, 12)
outcome <- gl(3, 1, 9)
treatment <- gl(3, 3)
f <- glm(counts ~ outcome + treatment, family = poisson())
# only showing treatment effects
broomExtra::tidy_parameters(f) %>%
dplyr::filter(!grepl(pattern = "outcome", x = term, ignore.case = TRUE)) %>%
ggstatsplot::ggcoefstats(., statistic = "z", exclude.intercept = FALSE)
Created on 2020-10-09 by the reprex package (v0.3.0)
glm is the base-R function, in rms it is capitalized so rms::Glm() Could you try that?
On Fri, Oct 9, 2020, 03:09 Indrajeet Patil notifications@github.com wrote:
Hmm, I actually can't reproduce this error:
set.seed(123) library(ggstatsplot) library(rms)
Dobson (1990) Page 93: Randomized Controlled Trial :counts <- c(18,17,15,20,10,20,25,13,12)outcome <- gl(3,1,9)treatment <- gl(3,3)f <- glm(counts ~ outcome + treatment, family=poisson())
ggstatsplot::ggcoefstats(f)
Created on 2020-10-09 by the reprex package https://reprex.tidyverse.org (v0.3.0)
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/IndrajeetPatil/ggstatsplot/issues/460#issuecomment-706012455, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGNA6COEGSBUFH2KTVHPPUDSJ2ZKJANCNFSM4SJQCHXQ .
Oops, sorry about that.
I can reproduce this now.
set.seed(123)
library(ggstatsplot)
library(rms)
## Dobson (1990) Page 93: Randomized Controlled Trial :
counts <- c(18,17,15,20,10,20,25,13,12)
outcome <- gl(3,1,9)
treatment <- gl(3,3)
f <- Glm(counts ~ outcome + treatment, family=poisson())
broomExtra::tidy_parameters(f)
#> NULL
Created on 2020-10-09 by the reprex package (v0.3.0)
Closed in favor of https://github.com/easystats/parameters/issues/313
Issue: Using rms::GLM but ggcoefstats(x = model) throws out an error that
The tidy dataframe *must* contain column called 'estimate'. Check the tidy output using argument 'output = 'tidy'.
Usingnames(model) <- "estimate"
to change the name works on the model output but error persists.Request: feature to specify which estimates to display from model (e.g remove controls from condensed visualization) similar to coefplot's
predictors
argument.