Hello,
I am trying to make one table with the first stage of an IV and a second table with the 2SLS results. The first stage is run using -reg-, and the 2SLS is run with -ivreg2-. The test statistic in question is the Montiel-Pflueger (2013) effective F statistic, which is obtained by running the user-contributed -weakivtest- (which can be installed from SSC) after -ivreg2-, and calling the stored value r(F_eff). I am storing results and exporting Latex tables of the regression results with user-contributed commands -eststo- and -esttab- (available in -estout- from SSC).
I would like to obtain the effective F stat from -weakivtest- after running the 2SLS in -ivreg2- and then print that effective F stat on the separate table I have for the first stage. How can I do this?
Here is my attempt using the cars data as a toy example. This code results in printing the Effective F on the table for 2SLS, correctly, but it prints a blank space in the row for the Effective F stat on the table for the first stage, rather than printing the correct Effective F value:
Thanks in advance for your help!
I am trying to make one table with the first stage of an IV and a second table with the 2SLS results. The first stage is run using -reg-, and the 2SLS is run with -ivreg2-. The test statistic in question is the Montiel-Pflueger (2013) effective F statistic, which is obtained by running the user-contributed -weakivtest- (which can be installed from SSC) after -ivreg2-, and calling the stored value r(F_eff). I am storing results and exporting Latex tables of the regression results with user-contributed commands -eststo- and -esttab- (available in -estout- from SSC).
I would like to obtain the effective F stat from -weakivtest- after running the 2SLS in -ivreg2- and then print that effective F stat on the separate table I have for the first stage. How can I do this?
Here is my attempt using the cars data as a toy example. This code results in printing the Effective F on the table for 2SLS, correctly, but it prints a blank space in the row for the Effective F stat on the table for the first stage, rather than printing the correct Effective F value:
Code:
sysuse auto
ssc install estout
ssc install weakivtest
*first stage reg price weight, r
eststo m1
* 2SLS ivreg2 displacement (price=weight), r
eststo m2
weakivtest
quietly estadd scalar weakf=r(F_eff), replace
*save table for 2SLS esttab m2 using "cars_weakiv_2sls", ///
replace booktabs label se star(* 0.10 ** 0.05 *** 0.01) ///
s(weakf, ///
label("Effective F")) ///
substitute(_ \_ )
ivreg2 displacement (price=weight), r
weakivtest
est restore m2 // bring back the first stage entry
quietly estadd scalar weakf=r(F_eff), replace
esttab m1 using "cars_weakiv_ols", ///
replace booktabs label se star(* 0.10 ** 0.05 *** 0.01) ///
s(weakf, ///
label("Effective F")) ///
substitute(_ \_ )
Thanks in advance for your help!

Comment