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
loop regressionDear, I have a set of different dependent variables and a common set of controls. Furthermore, I ne…
Factor variables in qregDear all, I am writing a code on some flexible estimation method and I wanted to use "qreg" as preli…
Using DateTime as Independent Variable - Regression Discontinuity in TimeHi everyone! In the same vein as Davis (http://faculty.haas.berkeley.edu/lda...JPE%202008.pdf), I w…
Meta-analysis: inverse variance heterogeneity modelDear all, I am trying to perform a meta-analysis using the inverse variance heterogeneity model as …
cmp for instrumental multinomial probit when there is cluster, baseoutcome, if conditionsI have been running non-instrumental multinomial probit that roughly looks like Code: mprobit Y X…
Subscribe to:
Post Comments (Atom)
0 Response to Summary statistics per cik per year
Post a Comment