'Convert poisson regression results table to wide
I've read a small function to convert the results to wide: https://gist.github.com/ddsjoberg/a55afa74ac58e1f895862fcabab62406, and wondering if it can be done for poison regression? I'd appreciate using this example below
p <- read.csv("https://stats.idre.ucla.edu/stat/data/poisson_sim.csv")
p <- within(p, {
prog <- factor(prog, levels=1:3, labels=c("General", "Academic",
"Vocational"))
id <- factor(id)
})
glm(num_awards ~ prog+math, family="poisson", data=p) %>%
tbl_regression(exponentiate = TRUE,include=prog) %>%
add_significance_stars(
pattern = "{estimate} ({conf.low},{conf.high}){stars}",
hide_ci = TRUE,
hide_p = TRUE,
hide_se = TRUE)
Want to convert the table from
But I want the model to be a poisson regression
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|