Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem in adding p-values of null hypothesis while creating a table

    Greetings!

    As per the model on which I am working where I try to find the impact of mentoring versus formal business classes on profits of small entrepreneurs, I regressed profits (tprofits) on Mentee (a categorical variable if assigned the status of mentorship), Class (a categorical variable if assigned the status of business classes), previous years baseline profits (tprofits_b) and a few other control variables like age, education, sector fixed effects etc. for which I used the global command: ($controls). The code I ran is as follows:

    global controls ln_age higher_edu l_empl sec_0 sec_1 sec_02
    reg tprofits Mentee Class tprofits_b $controls, cluster(id) robust
    estadd local Controls "Yes", replace
    est sto tab3_col1

    reg tprofits Mentee Class tprofits_b $controls if months_since_treatment == 1, cluster(id) robust
    estadd local Controls "Yes", replace
    est sto tab3_col2

    reg tprofits Mentee Class tprofits_b $controls if months_since_treatment == 17, cluster(id) robust
    estadd local Controls "Yes", replace
    est sto tab3_col3
    esttab tab3_col* using table3.rtf, replace label b(3) se(3) stats(N r2 Controls, fmt(0 3 0) labels("Observations" "R2" "Controls")) nomtitle onecell

    1. My first question is that in my newly created table, I want only the Mentee and Class variables to be displayed on the rows, however, although I control for the other variables, I do not want to display them in my table. I am not able to use the absorb command as the error message says that there are too many variables to absorb. Could you please tell me how I can go about this?
    2. I also want to add the p-value of the null hypothesis: Mentee = Class to test for the equality in the treatment effects across these 2 groups using estadd command for each of the columns, but totally clueless how to add them.

    Thanks in advance for your precious time!

  • #2
    Note that estout is from SSC (FAQ Advice #12). No data example, so I will create one. For #1, you want to use the -keep()- option to specify what variables to keep or conversely, the -drop()- option to specify what variables to drop. For #2, an option is to display the F-statistic of equality of coefficients and include significant stars to indicate whether it is significant as in #2 of https://www.statalist.org/forums/for...gression-table, but I will illustrate what you ask.

    Code:
    sysuse auto, clear
    eststo m1: regress price mpg weight i.rep78 turn disp, robust
    test mpg=weight
    return list
    estadd scalar fst= r(F)
    estadd scalar pval=r(p)
    estadd local Controls "Yes"
    *INTERESTED IN COEFFICIENTS ON MPG AND WEIGHT
    esttab m1, stats(Controls N r2 fst pval, label(Controls N R-squared "F-stat. (mpg= weight)" "p-value")) keep(mpg weight) varwidth(23) star(* 0.1 ** 0.05 *** 0.01)
    Res.:

    Code:
    . esttab m1, stats(Controls N r2 fst pval, label(Controls N R-squared "F-stat. (mpg= weight)" "p-value")) keep(mpg weight) varwidth(23) star(* 
    > 0.1 ** 0.05 *** 0.01)
    
    ---------------------------------------
                                     (1)   
                                   price   
    ---------------------------------------
    mpg                           -95.42   
                                 (-0.98)   
    
    weight                         2.002   
                                  (1.46)   
    ---------------------------------------
    Controls                         Yes   
    N                                 69   
    R-squared                      0.442   
    F-stat. (mpg= weight)          1.006   
    p-value                        0.320   
    ---------------------------------------
    t statistics in parentheses
    * p<0.1, ** p<0.05, *** p<0.01
    Last edited by Andrew Musau; 13 Dec 2022, 06:05.

    Comment


    • #3
      Andrew! Thank you soooo much!!! It worked perfectly:D

      Comment

      Working...
      X