Not quite. To understand why, notice that the local macro bottom_fifth is being defined in the previous line, where it takes the value of r(p5). Where is the value of r(p5) coming from? It is coming from the previous line, which has the summ command, which returns a bunch of scalars, including this one. For instance, with your example dataset, if I do
it returns the following results:
As you can see, this includes r(p5). So the code as it stands, will give you the fifth percentile of L in that year. If you want the fifth percentile of wage, you need to change the summ command so it is giving you the statistics for that.
Code:
. summ L if year == 2010, detail L ------------------------------------------------------------- Percentiles Smallest 1% 1 1 5% 1 3 10% 1 9 Obs 4 25% 2 12 Sum of wgt. 4 50% 6 Mean 6.25 Largest Std. dev. 5.123475 75% 10.5 1 90% 12 3 Variance 26.25 95% 12 9 Skewness .091223 99% 12 12 Kurtosis 1.303915
Code:
. return list scalars: r(N) = 4 r(sum_w) = 4 r(mean) = 6.25 r(Var) = 26.25 r(sd) = 5.123475382979799 r(skewness) = .091222998923078 r(kurtosis) = 1.303915343915344 r(sum) = 25 r(min) = 1 r(max) = 12 r(p1) = 1 r(p5) = 1 r(p10) = 1 r(p25) = 2 r(p50) = 6 r(p75) = 10.5 r(p90) = 12 r(p95) = 12 r(p99) = 12
Comment