friosavila / stpackages

Repository for all my Stata packages
MIT License
11 stars 9 forks source link

Is there a way to get scalars (N, N_treated, N_control, etc.) from RIF files? #1

Closed Mbjoerkh closed 9 months ago

Mbjoerkh commented 1 year ago

Hi,

Thanks for making a great set of tools..

I have a simple question. Is there a way to get the usual scalars (N, N_treated, N_control, etc.) from a "RIF" file?

Use case: Since the estimations I'm doing are time consuming, I've run a loop over several outcomes overnight using the saverif option. It would be good if there was a way to get the usual scalars from the csdid_stats or csdid_rif commands. Thanks!

foreach y in y1 y2 ... yN {
    csdid `y' , ivar(id) time(period) gvar(event_period) saverif(_`y') replace  
}
friosavila commented 1 year ago

Hi Markus mmm, unfortunately not. I havent figure out how to save those in the RIF file. However, something you could do is to save the e() data perhaps:

foreach y in y1 y2 ... yN { csdid y' , ivar(id) time(period) gvar(event_period) saverif(_y') replace

    est save _`y', replace

}

this will create a STER file where the N, N_treated, N_control will be available.

F

On Wed, May 10, 2023 at 10:53 AM Markus B Bjoerkheim < @.***> wrote:

Hi,

Thanks for making a great set of tools..

I have a simple question. Is there a way to get the usual scalars (N, N_treated, N_control, etc.) from a "RIF" file?

Use case: Since the estimations I'm doing are time consuming, I've run a loop over several outcomes overnight using the saverif option. It would be good if there was a way to get the usual scalars from the csdid_stats or csdid_rif commands. Thanks!

foreach y in y1 y2 ... yN { csdid y' , ivar(id) time(period) gvar(event_period) saverif(_y') replace }

— Reply to this email directly, view it on GitHub https://github.com/friosavila/stpackages/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASZKKFVT765ILDPEODU2UHLXFOTVNANCNFSM6AAAAAAX43LHVU . You are receiving this because you are subscribed to this thread.Message ID: @.***>