This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Export glm and manova results from R in a publishable table

Hi all,

I would like to export the summary table of a "glm" model constructed with R and also of a MANOVA. Do you know any function that does this?

Thank you!

glm export statistics manova results

1 answer

I'd probably just write summary(lm) to a new variable name, call whichever parts of the summary I want and either write them to a .csv (and make tables in PPT) or assign them to a gt table using library(gt).

library(gt)

l <- lm(results ~ condition, data = df)
s <- summary(l)

#write to a csv and make table in PowerPoint or Excel
s$coefficients |> write.csv('coefficient_table.csv')

#or make a gt table
gt_tbl <- gt(s$coefficients) |>
     tab_header(
          title = "LM results",
          subtitle = s$call
     )

Log in to answer this question.