'Editing table - stargazer
I want to reproduce a similar table to the one I am attaching. I found some data frame online and am using them to practice.
I have 2 problems:
I can't get to remove the Dependent variable title and put Donations($) instead. I tried with dep.var.labels() and with column.labels=c() but it does not work.
I want to put the mean of the dependent variable in the bottom part. It seems like there is no Mean of the dep variable statistics code. I tried using keep.stat = c("rsq", "n", "all") but I only get r squared and observations, and not the rest of the statistics (my idea was to put "all" and then use omit.stat () to get rid of the ones that I do not need).
How do I insert these row labels?
Here is the code I used.
How can I fix this?
library(stargazer)
library(htmltools)
library(htmlTable)
## loading data frame
stargazer(attitude, type="text")
## the model
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)
## table
star.out=stargazer(linear.1, linear.2,
align=TRUE,
covariate.labels=c("Handling of Complaints","No Special Privileges",
"Opportunity to Learn","Performance-Based Raises","Too Critical","Advancement"),
keep.stat = c("rsq","n"), no.space=TRUE, type="html")
Here is the table I want to replicate:
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

