Displaying first stage statistics of ivreg2 using estout in Stata
I am trying to add the first stage statistics from the command
, namely AP F stat, to the output for the first stage results using
. I know that these statistics are stored in the matrix
from the second stage, but I am having a hard time figuring out how to represent these statistics in the results of the first stage. I tried the following and didn't work:
ivreg2 y `included' (q=z), first ffirst savefirst savefprefix(first_) estimates store m1 estadd matrix first=first: first_q estimates restore first_q
and then tried to include
as statistics in
and it doesn't work. I also tried adding the lines:
matrix first=e(first) estadd scalar APF=first[7,1]
and that doesn't work either. I also tried to write a new subcommand
and couldn't get it to work, and tried using the syntax
described in the help file
and that won't work either. (It looks like including parentheses anywhere in the parameter
results in an error.) I also tried the
and it didn't work.
When I type
matrix list first
I can see the correct APF value, but it is stored in a matrix, not a scalar, and
will not include it in the table, the cells are just empty. I also tried to just define a local scalar without using it
, and that won't work either. Any suggestions?
source to share
Am I missing something?
seems to work in this case.
clear set more off use http://fmwww.bc.edu/ec-p/data/hayashi/griliches76.dta // example from the help file xi i.year ivreg2 lw s expr tenure rns smsa _I* (iq=med kww age mrt), small first ffirst savefirst savefprefix(first_) mat first=e(first) estadd scalar APF=first[7,1] estout, c(b) stats(APF)
source to share