The above is the way I want my graph to look like.
gen percentage=.
gen payment_method=.
gen variation=.
set obs 10
replace percentage=0.16689679 in 1
replace percentage=0.31108774 in 2
replace percentage=0.18705977 in 3
replace percentage=0.13920317 in 4
replace percentage=0.19575253 in 5
replace variation=0 in 1/5
replace payment_method=1 in 1
replace payment_method=2 in 2
replace payment_method=3 in 3
replace payment_method=4 in 4
replace payment_method=5 in 5
replace percentage=0.15781844 in 6
replace percentage=0.31281248 in 7
replace percentage=0.17682493 in 8
replace percentage=0.16750586 in 9
replace percentage=0.1850383 in 10
replace variation=1 in 6/10
replace payment_method=1 in 6
replace payment_method=2 in 7
replace payment_method=3 in 8
replace payment_method=4 in 9
replace payment_method=5 in 10
list
the above is how my dataset look like
basically what I want to do is twoway connected percentage variation
BUT I want the marker shape to vary on the payment_method and want to put legends on each marker shape
so I tried:
twoway (connected percentage variation if payment_method==1, msymbol(circle))(connected percentage variation payment_method==2, msymbol(triangle))(connected percentage variation payment_method==3, msymbol(diamond))(connected percentage variation payment_method==4, msymbol(square))(connected percentage variation payment_method==5, msymbol(X))
but all I get was:
== invalid name
r(198);
Does anyone have idea? Thank you in advance!
Comment