Skip to content

Instantly share code, notes, and snippets.

@chris-prener
Created November 6, 2017 16:19
Show Gist options
  • Save chris-prener/eff7358f57c492ce2ea58c67470de9fa to your computer and use it in GitHub Desktop.
Save chris-prener/eff7358f57c492ce2ea58c67470de9fa to your computer and use it in GitHub Desktop.
SOC 4930 & SOC 5050 - Week 11 - Producing Correlation Output in R
library(ggplot2)
library(stargazer)
# load data
autoData <- mpg
# create correlation table
# requires that the corrTable function is available in your global environment
output <- corrTable(autoData, coef = "pearson", listwise = TRUE, round = 3, pStar = TRUE, cyl, cty, hwy)
# convert output to LaTeX
stargazer(output, title = "Example Correlation Table", summary = FALSE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment