Displaying p-values instead of SEs in parenthesis

后端 未结 1 1984
盖世英雄少女心
盖世英雄少女心 2021-01-18 00:57

When using the stargazer package, I want to change the value that appears in parentheses under the coefficients. By default, the package will output the standar

相关标签:
1条回答
  • 2021-01-18 01:24

    As mentioned in Stargazer Omit test statistics, since version 5.0 stargazer has included the report argument that allows users to choose which statistics to report. So to display p-values instead of SEs you would do this:

    require(stargazer)
    linear.1 <- lm(rating ~ complaints + privileges + learning 
                            + raises + critical, data=attitude)
    ## put in the p-values rather than the se's
    stargazer(linear.1, type="text", report=('vc*p'))
    

    Which will output:

    > stargazer(linear.1,  type="text", report=('vc*p'))
    
    ========================================
                     Dependent variable:    
                 ---------------------------
                           rating           
    ----------------------------------------
    complaints            0.692***          
                         p = 0.0002         
    
    privileges             -0.104           
                          p = 0.450         
    
    learning                0.249           
                          p = 0.132         
    
    raises                 -0.033           
                          p = 0.870         
    
    critical                0.015           
                          p = 0.918         
    
    Constant               11.010           
                          p = 0.357         
    
    ----------------------------------------
    Observations             30             
    R2                      0.715           
    Adjusted R2             0.656           
    F Statistic           12.060***         
    ========================================
    Note:        *p<0.1; **p<0.05; ***p<0.01
    

    This approach is safer than using the se argument, and doesn't mess the significance stars.

    See also:

    • Unprecise p-values in Stargazer
    0 讨论(0)
提交回复
热议问题