I ran a couple of simple OLS and used stargazer as below
stargazer(reg01, reg02, type="html")
However, the output in the RMD file simply lists the elements in rows not in a nice table Any idea why this is happening?
Thank you for your help!
I ran a couple of simple OLS and used stargazer as below
stargazer(reg01, reg02, type="html")
However, the output in the RMD file simply lists the elements in rows not in a nice table Any idea why this is happening?
Thank you for your help!
It looks like that you are trying to render to a PDF format (output: pdf_document
), but give the table the type of a HTML file.
Here is a MWE with the correct YAML header for type = "html". For the next time, please add a complete MWE.
---
output: html_document
---
```{r results='asis'}
## OLS models
library(stargazer)
linear.1 <- lm(rating ~ complaints + privileges + learning + raises + critical,
data=attitude)
linear.2 <- lm(rating ~ complaints + privileges + learning, data=attitude)
## create an indicator dependent variable, and run a probit model
attitude$high.rating <- (attitude$rating > 70)
probit.model <- glm(high.rating ~ learning + critical + advance, data=attitude,
family = binomial(link = "probit"))
stargazer(linear.1, linear.2, probit.model, title="Results", type="html")
```