I'm trying to create descriptive statistics in a "publishable" html format.
Let's take the mtcars data and assume I want to create a table that gives me the usual descriptive statistics for Miles/(US) gallon, Gross horsepower, Weight (1000 lbs), and 1/4 mile time for both automatic and manual cars.
I can get a rough version of what I am looking for by using psych::describeBy
library(tidyverse)
library(psych)
#Descriptive statistics
data("mtcars")
df <- mtcars|>
select(1,4,6,7,9)
describeBy(df, group = mtcars$am, fast=TRUE)
However, I am trying to create this in a format that is close to what you would find in journal articles and also can be exported as html. Anyone got any suggestions? I tried to use stargazer but struggled to get results for both groups in one table. Thanks!