Home > Enterprise >  How do I remove the model type from stargazer output?
How do I remove the model type from stargazer output?

Time:11-07

Example data:

library(sure) # for residual function and sample data sets
library(MASS) # for polr function
library(stargazer)
#rm(df1)
data("df1", package="sure")
data("df2", package="sure")
df1 <- df1
df1$x2 <- df2$y
df1$x3 <- df2$x
df1$y <- df3$x/10

lm1 <- lm(y~x, data=df1)
lm2 <- lm(y~x, data=df1)
polr1<- polr(x2~x3, method="probit", Hess=TRUE, data=df1)
depvarlab <- c("-", "-", "-")
stargazer(lm1, lm2, polr1, type="text", dep.var.labels = depvarlab, keep.stat=c("n", "rsq"))

I have tried everything to exclude the model types (OLS etc.), without success. How do I keep stargazer from displaying the model type?

CodePudding user response:

One can set model.names to FALSE.

stargazer(lm1, lm2, polr1, type="text", 
                                        dep.var.labels = depvarlab, 
               keep.stat=c("n", "rsq"), model.names = FALSE)
    
    ==========================================
                      Dependent variable:     
                 -----------------------------
                          -              -    
                    (1)        (2)      (3)   
    ------------------------------------------
    x             0.100***  0.100***          
                  (0.000)    (0.000)          
                                              
    x3                                0.088***
                                      (0.018) 
                                              
    Constant     -0.000***  -0.000***         
                  (0.000)    (0.000)          
                                              
    ------------------------------------------
    Observations   2,000      2,000    2,000  
    R2             1.000      1.000           
    ==========================================
    Note:          *p<0.1; **p<0.05; ***p<0.01
  • Related