Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Strange interaction between weights and the -mlabel()- option


From   Roger Newson <roger.newson@kcl.ac.uk>
To   statalist@hsphsun2.harvard.edu
Subject   st: Strange interaction between weights and the -mlabel()- option
Date   Mon, 22 Nov 2004 18:31:46 +0000

Fellow Statalisters (especially StataCorp):

I am currently using Stata 8.2 under Windows 2000, with executable and ado-files dated 06 Oct 2004, which is the latest available version according to -update query-. I have discovered what appears to be a strange interaction between weights and the -mlabel()- option of the -scatter-, -connected- and -dropline- plot subcommands of -graph twoway-. The weights seem to be ignored if -mlabel()- is specified. For instance, in the -auto- data, if I type

. twoway scatter mpg weight [awei=price]

then, as expected, -mpg- is plotted against -weight-, with symbols unlabelled and weighted by -price-. And, if I type


. twoway scatter mpg weight, mlab(make)

then, as expected, -mpg- is plotted against -weight-, with symbols unweighted and labelled by -make-. However, if I type

. twoway scatter mpg weight [awei=price], mlab(make)

then -mpg- is plotted against -weight-, and the symbols are labelled by -make-, but are unweighted. The same interaction is observed if I use -pweights- and -fweights- instead of -aweights-, and if I use -twoway connected- or -twoway dropline- instead of -twoway scatter-.

Is this interaction intentional or a bug? And does it have any connection to the similar strange interaction between weights and the -connect()- option which I discovered earlier (and which was fixed in the update of 05 Oct 2004 - thanks again to StataCorp for that)? I can find no mention of it in -[G] graph twoway scatter-. However, I realise that, if the symbols are weighted, then there may possibly be a problem deciding the default value for the -mlabgap()- option.

Best wishes (and thanks in advance)

Roger


--
Roger Newson
Lecturer in Medical Statistics
Department of Public Health Sciences
King's College London
5th Floor, Capital House
42 Weston Street
London SE1 3QD
United Kingdom

Tel: 020 7848 6648 International +44 20 7848 6648
Fax: 020 7848 6620 International +44 20 7848 6620
or 020 7848 6605 International +44 20 7848 6605
Email: roger.newson@kcl.ac.uk
Website: http://www.kcl-phs.org.uk/rogernewson

Opinions expressed are those of the author, not the institution.

*
* 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/




© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index