I am making a line plot of Average test scores against Year for several countries (Jurisdictions) in Latin America. The following command, when applied to the attached data, gets me almost what I want, with each line rendered somewhat differently (solid, broken, dotted, etc.). The only problem is that the legend labels each line symbol as "Average" instead of labeling it with the name of the Jurisdiction. How can I get the lines labeled with the names of the Jurisdiction? Many thanks.
clear
import excel "C:\Users\pvonhippel\Box Sync\Chile\PISA trends, IDEExcelExport-Oct052017-0229PM.xls", firstrow sheet("To import")
destring Average Year, replace
twoway (line Average Year if Jurisdiction=="Brazil") ///
(line Average Year if Jurisdiction=="Chile") ///
(line Average Year if Jurisdiction=="Colombia") ///
(line Average Year if Jurisdiction=="Costa Rica") ///
(line Average Year if Jurisdiction=="Mexico") ///
(line Average Year if Jurisdiction=="Panama") ///
(line Average Year if Jurisdiction=="Peru") ///
(line Average Year if Jurisdiction=="Uruguay")
clear
import excel "C:\Users\pvonhippel\Box Sync\Chile\PISA trends, IDEExcelExport-Oct052017-0229PM.xls", firstrow sheet("To import")
destring Average Year, replace
twoway (line Average Year if Jurisdiction=="Brazil") ///
(line Average Year if Jurisdiction=="Chile") ///
(line Average Year if Jurisdiction=="Colombia") ///
(line Average Year if Jurisdiction=="Costa Rica") ///
(line Average Year if Jurisdiction=="Mexico") ///
(line Average Year if Jurisdiction=="Panama") ///
(line Average Year if Jurisdiction=="Peru") ///
(line Average Year if Jurisdiction=="Uruguay")
Comment