Hello,
I would like to report in my results the number of firms that are included in my regression.
I am using panel data and firms are not my panel id. My panel id represents firm-country dyads.
When running a fixed effect model, many panel ids are dropped because of single observations per group or all zero outcomes.
My question is the following: How can I know how many firms were included in that regression? The number of firms does not equal the number of groups and it is unclear which groups were dropped. Would it be possible to run a distinct option on my firm variable in the post estimation results?
I tried to replicate the dropped groups by dropping singletons and panel ids with zero outcomes in all years in my dataset (with the intention to run codebook firm to identify the number of unique firms).
I am getting close but the regression still drops more groups than I identified with the two previous commands.
Thank you.
I would like to report in my results the number of firms that are included in my regression.
I am using panel data and firms are not my panel id. My panel id represents firm-country dyads.
Code:
egen panel_id=group(firm country2) egen temp=group(panel_id year) bysort temp : egen temp1=count(year) drop if temp1>1 xtset panel_id year
Code:
xtpoisson dv c.x1##c.x2 $controls i.year, fe note: 25704 groups (25704 obs) dropped because of only one obs per group note: 47820 groups (187270 obs) dropped because of all zero outcomes Conditional fixed-effects Poisson regression Number of obs = 75,676 Group variable: panel_id Number of groups = 14,083 Obs per group: min = 2 avg = 5.4 max = 9
I tried to replicate the dropped groups by dropping singletons and panel ids with zero outcomes in all years in my dataset (with the intention to run codebook firm to identify the number of unique firms).
Code:
*Delete all outcomes == 0 bysort panel_id: egen temp2 = sum(dv) gen temp3=1 if temp2>0 replace temp3=0 if temp2==0 drop if temp2==0 *Delete singletons bysort panel_id : drop if _N==1
Code:
xtpoisson dv c.x1##c.x2 $controls i.year, fe note: 2896 groups (2896 obs) dropped because of only one obs per group note: 580 groups (1896 obs) dropped because of all zero outcomes Conditional fixed-effects Poisson regression Number of obs = 75,676 Group variable: panel_id Number of groups = 14,083 Obs per group: min = 2 avg = 5.4 max = 9
Thank you.
Comment