- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Dear all,
for the .excel file in the attachment, how to create the line chart of each "person_ctry_code" group, which just like the following picture?
The Y-axis is the no_app_per_year and no_app_per_year;
the X-axis is the years from 1990 to 2012.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Use PROC SGPLOT with the SERIES statement and the GROUP= option.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Instead of SCATTER use SERIES but the rest is the same.
@Alexxxxxxx wrote:
Dear all,
for the .excel file in the attachment, how to create the line chart of each "person_ctry_code" group, which just like the following picture?
The Y-axis is the no_app_per_year and no_app_per_year;
the X-axis is the years from 1990 to 2012.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
thanks for your suggestion.
however, when I use
proc sgplot data=Results.PATSTAT_no_full_hrm_with_ctry5;
SERIES x=year y=no_app_per_year / group=person_ctry_code;
SERIES x=year y=no_cit_per_year / group=person_ctry_code;
run;
all the lines are shown in one picture.
Could you please give me more suggestions about this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
For splitting it to mulitple graphs, put that variable in the BY statement instead.
You don't provide data so we're kinda guessing here.
proc sgplot data=have;
by var_for _each graph;
series x= year y=no_cit_per_year / group = person_ctry_code;
run;
If you want multiple graphs with different variables it's probably easiest to use multiple SGPLOT statements or restructure your data to support the BY processing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
the file is added in the attachment. please have a look.
besides, by using the code
proc sgplot data=Results.PATSTAT_no_full_hrm_with_ctry5;
by person_ctry_code;
series x= year y=no_app_per_year / group = person_ctry_code;
series x= year y=no_cit_per_year / group = person_ctry_code;
run;
I get a serious picture like
it looks much better now,
however, I expect to get a picture of each "person_ctry_cod" and for each picture, there are two lines, one is the no_app_per_year, one is no_cit_per_year. for current picture, the explanation of line and Y-axis are wrong.
Could you please give me some suggestions about this?
thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks,
now I get a serious picture like
Is there any method to put them together like the Figure2.1,
and
1.delete the explanation at the Y-axis
2. replace ALL with no_app_per_year, replace By corporation with no_cit_per_year,
3. replace "PERSON_CTRY_CODE=AT" with "AT"?
Sorry, I have a lot of questions. I just start to learn how to use SAS to draw the line chart
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Not sure how the legend part would work you'll need to customize that with keylegend.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Heat Map ?