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

Re: st: creating a difficult graph (not sure what to call it)


From   Ulrich Kohler <[email protected]>
To   [email protected]
Subject   Re: st: creating a difficult graph (not sure what to call it)
Date   Fri, 29 Nov 2002 11:42:49 +0100

Just had a little exchange with Thomas Gschwend about the problem. Thereby we 
set up the following Do-File which might further clarify my last posting. 
So I send it along:

----------------------------------------trydo.do
clear
input x
1
2
3
4
end

gen y = x
fillin x y
gen n = int(uniform()*100)+1
expand n

graph y x, yline(1.5(1)3.5) xline(1.5(1)3.5) xlab(1(1)4) ylab(1(1)4) /*
*/ jitter(5) xscale(0.5,4.5) yscale(0.5,4.5) border
------------------------------------------------------


> I am hoping to create a graph which is an X by Y matrix.  Each cell is
> shaded according to the percentage of observations in that cell (in some
> sense this is a table in graphical form).  Does anyone have any ideas how
> to approach this in stata?  Maybe an example will help:
>
> X is industries, Y is occupations:  the graph would look like this where
> letters represent shadings based on the % in each cell
>
> 	   1	    2	    3            4
> 	---------------------------------
>    1	|  lllll	|  lllll	|  mmm	| mmm	|
> 	---------------------------------
>    2	| dddd	|  ddd	|  lllll	| mmm	|
> 	---------------------------------
>    3	| llllll	| mmm	| llll	| ddd	|
> 	---------------------------------
>    4	| dddd	|  mmm	| dddd	| llllll	|
> 	---------------------------------
>
> Or is the easier to do in excel?
>
> Steve

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index