You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This package allows us to draw arc plots in Stata. It is based on the [Arc plot Guide](https://medium.com/the-stata-guide/stata-graphs-arc-plots-eb87015510e6)that I released in October 2021.
6
+
This package allows us to draw arc plots in Stata. It is based on the [Arc plot Guide](https://medium.com/the-stata-guide/stata-graphs-arc-plots-eb87015510e6)(October 2021).
7
7
8
8
9
9
## Installation
@@ -16,7 +16,7 @@ SSC (**v1.0**):
16
16
ssc install arcplot, replace
17
17
```
18
18
19
-
GitHub (**v1.0**):
19
+
GitHub (**v1.1**):
20
20
21
21
```
22
22
net install arcplot, from("https://raw.githubusercontent.com/asjadnaqvi/stata-arcplot/main/installation/") replace
@@ -56,7 +56,9 @@ The syntax for **v1.0** is as follows:
display as error "The palettes package is missing. Install the {stata ssc install palettes, replace:palettes} and {stata ssc install colrspace, replace:colrspace} packages."
34
+
display as error "The {bf:palettes} package is missing. Click to install: {stata ssc install palettes, replace:palettes} and {stata ssc install colrspace, replace:colrspace}."
32
35
exit
33
36
}
34
37
38
+
capture findfile gtools.ado
39
+
if _rc != 0 {
40
+
display as error "The {bf:gtools} package is missing. Click to install: {stata ssc install gtools, replace:gtools}."
41
+
exit
42
+
}
35
43
36
44
capture findfile labmask.ado
37
45
if _rc != 0 {
38
-
display as error "The {it:labmask} package is missing. Click {stata ssc install labutil, replace} to install."
39
-
exit
46
+
qui install labutil, replace
40
47
}
41
48
42
49
marksample touse, strok
43
50
44
51
preserve
45
-
46
52
qui {
47
53
48
54
keep if `touse'
@@ -56,17 +62,17 @@ qui {
56
62
57
63
gen id = _n
58
64
59
-
reshape long lab, i(id) j(layer)
65
+
greshape long lab, i(id) j(layer)
60
66
61
67
encode lab, gen(lab2)
62
68
63
-
sort lab layer value
69
+
sort lab layer `varlist'
64
70
bysort lab: gen order = _n
65
71
66
72
egen tag = tag(lab)
67
73
68
74
expand 2 if tag==1, gen(tag2)
69
-
replacevalue= 0 if tag2==1 // duplicate entries are labeled as zero
75
+
replace`varlist'= 0 if tag2==1 // duplicate entries are labeled as zero
70
76
replace order = 0 if tag2==1
71
77
replace id = 0 if tag2==1
72
78
@@ -75,9 +81,9 @@ qui {
75
81
76
82
// generate cumulative values
77
83
sort lab layer order
78
-
bysort lab: gen double valsum = sum(value)
84
+
bysort lab: gen double valsum = sum(`varlist')
79
85
80
-
gen double valsumtot = sum(value)
86
+
gen double valsumtot = sum(`varlist')
81
87
sort lab layer order
82
88
83
89
// add gaps between arcs
@@ -142,7 +148,7 @@ qui {
142
148
// start future block. these are used much later in the last step after reshape
{p 4 8 2}Jann, B. (2018). {browse "https://www.stata-journal.com/article.html?article=gr0075":Color palettes for Stata graphics}. The Stata Journal 18(4): 765-785.
119
132
120
-
133
+
{p 4 8 2}Caceres, M. (2022). {browse "https://gtools.readthedocs.io/en/latest/":Gtools website}.
0 commit comments