(First of all, for anyone vaguely interested
but unclear what is being discussed,
-binsm- was published in STB-37.)
I did consider this, but am not keen on
such a solution.
-binsm- can show several summary functions
for each of a series of bins (read vertical
bands on a scatter plot). So a call might
include (in the new and as yet unpublished
syntax)
... su(mean median gmean)
and -binsm- calls up those -egen- functions.
Adding an extra "bag" option would clearly
be possible, but starts everyone moving on
a slippery slope.
Users are then going to try to see if (say)
... su(wtmean median gmean) egenopts(w(foobar))
works and wonder either on Statalist or
to me why it does not work, whether there
is a way round it, and so on and so forth.
In short, this is my program and I draw the
line somewhere at complicating it further,
given other things to do. Once the program
is available anyone is free to clone it and
modify it if it doesn't do what they want.
Nick
[email protected]
David Harrison
> One further suggestion for -binsm-...
>
> If you add an option to pass additional options to -egen-,
> then weighted
> means (and various other things) could be achieved by using a
> user-written -egen- function (e.g. _GWTMEAN).
Nick Cox
> I've updated the program to Stata >=8 graphics, but the
> limitation to no
> support of weights remains. This will appear via a future issue of the
> Stata Journal.
>
> In essence -binsm- is a wrapper for -egen- as far as calculation of
> summaries is concerned.
> As established in this thread, -egen-
> does not support weights in general. I can't think of a
> work-around that
> would not be ad hoc, awkward, and very time-consuming.
>
> Supporting -egen- may appear to be bad
> programming style, as sometimes deprecated by myself among others. In
> this case, it is a way of providing a lot of flexibility, including
> support in principle for user-written functions, with minimal
> programming effort.
>
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/