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

st: RE: RE: RE: Bad dotplot command?


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: RE: RE: Bad dotplot command?
Date   Thu, 28 Oct 2004 23:41:46 +0100

Here is a quick hack at your problem: 

mdotplot mdint_bioc mdint_bioc_s median948 
if mch==10 & inlist(nwafer,1,2,5,6,7,8)
, center msymbol(none) mlabel(mlbl) mlabsize(tiny)
mlabposition(0)

program mdotplot
	version 8 
	syntax varlist(numeric) [if] [in] [, combine(passthru) *] 

	marksample touse
	qui count if `touse' 
	if r(N) == 0 error 2000 

	tokenize `varlist' 
	local nvars : word count `varlist' 

	forval i = 1/`nvars' { 
		tempname g`i' 
		dotplot ``i'' if `touse', `options' nodraw name(`g`i'')
		local G "`G' `g`i''"
	}

	// ycommon wired in 
	local 0 , `combine' 
	syntax [, imargin(str) * ] 
	if "`imargin'" == "" local options "`options' imargin(zero)" 

	graph combine `G', ycommon `options' 
end 	

Nick 
n.j.cox@durham.ac.uk 

> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu
> [mailto:owner-statalist@hsphsun2.harvard.edu]On Behalf Of 
> Wallace, John
> Sent: 28 October 2004 22:35
> To: statalist@hsphsun2.harvard.edu
> Subject: st: RE: RE: Bad dotplot command?
> 
> 
> Thanks for the explanation, Nick.  I similarly found that a plotting a
> single variable mapped the marker labels correctly, which 
> allowed me to
> explore the data as I wished, although in a less data-dense fashion
> (which my boss would probably say is better anyway!)  I tend to like
> fewer charts with more information in them.
> 
> -JW
> 
> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu
> [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Nick Cox
> Sent: Wednesday, October 27, 2004 3:10 AM
> To: statalist@hsphsun2.harvard.edu
> Subject: st: RE: Bad dotplot command?
> 
> A -dotplot- to Stata is really just a special kind of scatter plot. 
> 
> The trickery within -dotplot- is to map the values of one or more 
> variables to the coordinates needed to produce this scatter plot. 
> 
> When you ask for a -dotplot- of two or more variables, rather more 
> is involved than with just one. In the temporary restructuring of 
> your dataset that's required, not everything that might be needed 
> for a plot is carried over. In particular, marker 
> labels are, as a side-effect, not supported. I imagine that 
> programming 
> that was just a complication too far as far the programmer was 
> concerned, but that it was decided to trap such requests. Most people 
> who produce dotplots just use plain symbols, I imagine. 
> 
> I just checked with the unofficial -onewayplot-, which offers a 
> similar display, and found that in effect I made a similar decision, 
> although it is not trapped at source. 
> 
> In short, I surmise that your request is reasonable but at 
> present just 
> not supported by -dotplot-. 
> 
> Nick 
> n.j.cox@durham.ac.uk 
> 
> Wallace, John
> 
> > I've been using dotplots as an exploratory tool for a while now, and
> > suddenly I'm getting an error message where I previously have 
> > never had a
> > problem:
> > 
> > . dotplot mdint_bioc mdint_bioc_s median948 if mch==10 & 
> > inlist(nwafer,
> > 1,2,5,6,7,8), center msymbol(none) mlabel(mlbl) mlabsize(tiny)
> > mlabposition(0)
> > 
> > which gives me r(198); option mlabel() not allowed
> > 
> > mlbl is a short string variable containing grouping information
> > 
> > Am I doing something boneheaded?  I even tried using the 
> > dotplot dialog to
> > construct the syntax with the same result. 
> > 
> 
> *
> *   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/
> 
> *
> *   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/
> 

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