Hello, I have a panel data and I want to keep the observation with the minimum value of Days for each InstitutionID and Accper. Then, I want to get the Median of ForecastAccuracy for each Stkcd and Accper for the observations that I keep. In other words, for any certain Stkcd and Accper, if there is more than one observation for InstitutionID, then keep the one with the lowest value of Days. After that, compute the Median of ForecastAccuracy for each Stkcd and Accper.
Stkcd Accper Rptdt Days InstitutionID ForecastAccuracy
000001 2013-12-31 2013-10-23 69 10101837 0.0054
000001 2013-12-31 2013-12-16 15 10101837 0.0108
000001 2013-12-31 2013-10-22 70 101434 0.0108
000001 2013-12-31 2013-12-15 16 101434 0.1237
000001 2013-12-31 2013-12-16 15 101506 0.9677
000001 2013-12-31 2013-10-23 69 102333 0.0108
000001 2013-12-31 2013-10-23 69 104094 0.5699
000001 2013-12-31 2013-10-23 69 104096 0.1667
000001 2013-12-31 2013-10-22 70 104102 0.0323
000001 2013-12-31 2013-11-21 40 104102 0
000001 2013-12-31 2013-10-23 69 104104 0.129
000001 2013-12-31 2013-10-23 69 10416 0.0108
000001 2013-12-31 2013-10-23 69 104169 0.1774
000001 2013-12-31 2013-10-23 69 104393 0.1129
000001 2013-12-31 2013-10-22 70 105045 0.1237
000001 2013-12-31 2013-12-31 0 105045 0.1344
000001 2013-12-31 2013-10-22 70 105523 0.0323
000001 2013-12-31 2013-10-23 69 106033 0.0376
000001 2013-12-31 2013-10-22 70 106035 0.2527
000001 2013-12-31 2013-10-23 69 106064 0.129
000001 2013-12-31 2013-10-24 68 106064 0.129
000001 2013-12-31 2013-10-22 70 106067 0.0591
000001 2013-12-31 2013-11-15 46 106067 0
000001 2013-12-31 2013-10-23 69 106068 0.0215
000001 2013-12-31 2013-10-23 69 106071 0
000001 2013-12-31 2013-10-23 69 107973 0.1183
000001 2013-12-31 2013-10-22 70 10974 0.129
000001 2013-12-31 2013-12-15 16 10974 0.129
Related Posts with keeping observation with lowest value and get the median of that
Linear model with change as dependent variablehello, I would like to investigate whether sectors that invest relatively more in computer capital …
teffects psmatch - how to get the selected sample and apply common testsDear Forum Members, After applying the command - teffects psmatch -, I wish to get the selected sam…
tabout three ways tableDear Statlisters: I am trying to do a table that shows the proportions/percentages of ppl who answe…
Panel data: similar N to THello, I have panel dataset for 12 industries (N=12) over 2006-2017 (T=11). In order to be sure abo…
test Code: test reg …
Subscribe to:
Post Comments (Atom)
0 Response to keeping observation with lowest value and get the median of that
Post a Comment