-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathareastack.pkg
32 lines (31 loc) · 975 Bytes
/
areastack.pkg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
v 3
d areastack.
d
d graph command like "twoway area" which "stacks" the over(), instead of overlayin
d ng them.
d This program is similar to "twoway area",
d except that it "stacks" the areas to a cumulative height
d (similar to "graph bar ... , stack").
d
d At it's core, this program creates a "cumulative" y-variable
d . bys x_var (over_var) : gen cumulative = sum(x_var)
d
d Then, it executes a command like this:
d . graph twoway
d (area cumulative x_var if over_var==4 )
d (area cumulative x_var if over_var==3 )
d (area cumulative x_var if over_var==2 )
d (area cumulative x_var if over_var==1 )
d , legend(order(4 3 2 1) label(1 "over_var label 1") ... label(4 "over_var label
d 4"))
d
d Any options are passed along to the graph twoway command.
d
d By Keith Kranker
d $
f a/areastack.ado
f a/areastack.sthlp
d
d Program by Keith Kranker
* This Stata package file created automatically
* with Keith Kranker's package -pub2web-