I use the user written command "Repest" to analyse PISA survey data.
I then use eststo and esttab to export the results to LaTeX.
"Repest" stores the number of observation and r-squared as coefficients and not as statistic, so I have to use estadd to add them as a scalar.
My problem is that when I use estadd I get an error message.


The code I use is -
Code:

repest PISA, estimate(stata: reg pv@math female) /// results(add(N r2)) fast estadd scalar No = e_N estadd scalar r2 = e_r2 eststo m1 esttab m1
When I run esttab I get
Code:
----------------------------
                      (1)   
                            
----------------------------
female             -13.62***
                 (-12.30)   

_cons               456.4***
                 (411.44)   

e_N                515956   
                      (.)   

e_r2              0.00422***
                   (5.99)   
----------------------------
N                           
----------------------------
But the code gives an error message after the command
Code:
estadd scalar No = e_N
The error message is:
Code:
"e_N not found"
Could you help me extract these scalars (N and r2) after the "Repest" command?