Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: how to get hold of the observations used in reg2hdfe


From   Ryan Kessler <[email protected]>
To   [email protected]
Subject   Re: st: how to get hold of the observations used in reg2hdfe
Date   Wed, 30 Jan 2013 16:14:55 -0500

*******************************************

sysuse auto, clear

bysort rep78: gen time = _n

reg mpg price i.rep78 i.time
ereturn list
count if e(sample)

reg2hdfe mpg price, id1(rep78) id2(time)
ereturn list
count if e(sample)

*******************************************

The problem here appears to be that reg2hdfe does not return the
"e(sample)" function. I believe this can be accomplished by adding to
the "ereturn post" line the "esample(`varname')" option, where
"varname" is the sample indicator generated by marksample. See "help
ereturn"

Best,

Ryan

On Wed, Jan 30, 2013 at 11:57 AM, Nick Cox <[email protected]> wrote:
> Comments made yesterday still apply:
>
> http://www.stata.com/statalist/archive/2013-01/msg01170.html
>
> http://www.stata.com/statalist/archive/2013-01/msg01169.html
>
> http://www.stata.com/statalist/archive/2013-01/msg01155.html
>
> Please give a reproducible example based on a Stata-bundled dataset
> and precise commands that people can copy.
>
> Nick
>
> On Wed, Jan 30, 2013 at 3:35 PM, natasha agarwal
> <[email protected]> wrote:
>
>> I want to see the observations used.
>>
>> Like the top RHS shows I have used 3000 observations out of a dataset
>> of 4000. So I want to see which one's are used.
>
> On Wed, Jan 30, 2013 at 3:13 PM, Guo Xu <[email protected]> wrote:
>
>>> Are you trying to count the number of obs used? Doesn't that just show
>>> up on the top RHS of the output ("Number of obs")?
>>>
>>> Or are you trying to count the number of regressors/degrees-of-freedom?
>
> On 30 January 2013 16:04, natasha agarwal <[email protected]> wrote:
>
>>>> I am trying to estimate a model with reg2hdfe.
>>>>
>>>> I tried to count the number of observations with "count if e(sample)"
>>>>
>>>> However, I am unable to do the same after reg2hdfe. I get an output which says 0
>>>>
>>>> Has someone had the same problem ?
>>>>
>>>> Help will be greatly appreciated.
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index