Dear all,
I have a sample of panel data which contains data on a main firm: cik, a given year: year and the corresponding number of peer firms to a main firm:peercik (for each cik).
I would like to generate summary statistics (mean, median, minimum, maximum, st dev and N) for each year (my sample goes from 2006-2016).
However, I have to rearrange my data to find data I need: the mean, median, min, max, st dev, number of peers per cik per year.
I've tried the following:
sort year cik peercik
replace peercik=1
by year cik: egen npeer_cik=sum(peercik) if _n==1
However this does not work. Can anyone help me to find the average peercik statistics per year?
Best regards,
Patrick
Related Posts with Summary statistics per cik per year
Error message "Maximum numbers of iterations exceeded"Hello, I am in the process of building a regression model with a DV (q_tot), an IV (rdalliances), a…
Test for heteroskedasticity after spxtregressThe spatial Stata manual (https://www.stata.com/manuals/sp.pdf) makes clear that heteroskedasticity …
Residual assumptions for spxtregress, feDoes anyone know the assumptions that need to be met to use spxtregress, fe? In looking through the …
How To Count Identical Values As One Without DroppingDear Stata Community, I'm trying to 'count the number of years each person attended the conference …
ignore insufficient observations and run the loop without breakingHi, I would like to calculate cumulative security residual return, which is residual in a regression…
Subscribe to:
Post Comments (Atom)
0 Response to Summary statistics per cik per year
Post a Comment