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
intra class correlationHello to everybody, I'll try to do for the first time the calculation of intra class correlation bet…
Difference interaction with country variable and multilevelHey, I'm about to examine how a two-way interaction differs depending on the country (I examine thre…
Instrumental VariableHey everyone, I have the following equation: y=aX1+bX2+cX3+dX4+e I am instrumenting Z1 for X1 and…
checking linearity with lack of fit testHello, I'm running a linearity check (analitical data), and I'd like to run lack of fit test after l…
converting annual to quarty in Statahello , I have yearly(from 1996 to 2020) dataset of uncertainty trade, I want to change them to quar…
Subscribe to:
Post Comments (Atom)
0 Response to keeping observation with lowest value and get the median of that
Post a Comment