Various comments sprinkled here and there. You may have
strong reasons to use these decile bins, but binning strikes me as,
usually, at best a means towards an end (or perhaps ends towards some
means). Some nonparametric
regression might do more justice to the data.
Also, you are mixing two naming conventions 1...10 and 10...90. Just
use one.
Nick n.j.cox@durham.ac.uk
Thomas Erdmann

I am trying to sort my observations into deciles according to one
attribute
and afterwards calculating the average of another attribute of those
ten groups.

Please find the code I came up with below [lines with ... are
omitted], yrm is the time variable (YearMonth)
(1) As far as I can tell it works out, but a) it's a lot of code and
b)produces a lot of variables and c)generating the output is rather
awkward.
Could you give me hints on how to implement a smarter solution or if
there
are any errors in the way the calculation is carried out currently?