<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to plot evolution curve of a numeric variable according to a categorical variable in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-plot-evolution-curve-of-a-numeric-variable-according-to-a/m-p/838512#M36238</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Here is my dataset. I have two categorical variables (type_college and name) and a numeric variable (COL1).&lt;/P&gt;&lt;P&gt;I don't know how to plot on the same graph the evolution curves of COL1 according to name for each type_college.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data students;
  infile datalines dlm=',' dsd;
  informat type_college $15.  name $15. ; 
input  type_college   name $  COL1 ;
datalines;
College private,delai_dec20,1.5
College private,delai_juin21,3.6
College private,delai_dec21,4.4
College private,delai_sep22,47.6
College public,delai_dec20,5.3
College public,delai_juin21,6
College public,delai_dec21,14.4
College public,delai_sep22,14.4
University,delai_dec20,11.1
University,delai_juin21,14.3
University,delai_dec21,14
University,delai_sep22,17.1
,delai_dec20,5.6
,delai_juin21,7.1
,delai_dec21,12
,delai_sep22,18.1
;&lt;/PRE&gt;&lt;P&gt;here is exactly what I want for result.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture d’écran 2022-10-12 000900.png" style="width: 618px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76164i12B7A28D3392CB33/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture d’écran 2022-10-12 000900.png" alt="Capture d’écran 2022-10-12 000900.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Thu, 13 Oct 2022 20:36:15 GMT</pubDate>
    <dc:creator>Child79</dc:creator>
    <dc:date>2022-10-13T20:36:15Z</dc:date>
    <item>
      <title>How to plot evolution curve of a numeric variable according to a categorical variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-plot-evolution-curve-of-a-numeric-variable-according-to-a/m-p/838512#M36238</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Here is my dataset. I have two categorical variables (type_college and name) and a numeric variable (COL1).&lt;/P&gt;&lt;P&gt;I don't know how to plot on the same graph the evolution curves of COL1 according to name for each type_college.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data students;
  infile datalines dlm=',' dsd;
  informat type_college $15.  name $15. ; 
input  type_college   name $  COL1 ;
datalines;
College private,delai_dec20,1.5
College private,delai_juin21,3.6
College private,delai_dec21,4.4
College private,delai_sep22,47.6
College public,delai_dec20,5.3
College public,delai_juin21,6
College public,delai_dec21,14.4
College public,delai_sep22,14.4
University,delai_dec20,11.1
University,delai_juin21,14.3
University,delai_dec21,14
University,delai_sep22,17.1
,delai_dec20,5.6
,delai_juin21,7.1
,delai_dec21,12
,delai_sep22,18.1
;&lt;/PRE&gt;&lt;P&gt;here is exactly what I want for result.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture d’écran 2022-10-12 000900.png" style="width: 618px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76164i12B7A28D3392CB33/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture d’écran 2022-10-12 000900.png" alt="Capture d’écran 2022-10-12 000900.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2022 20:36:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-plot-evolution-curve-of-a-numeric-variable-according-to-a/m-p/838512#M36238</guid>
      <dc:creator>Child79</dc:creator>
      <dc:date>2022-10-13T20:36:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot evolution curve of a numeric variable according to a categorical variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-plot-evolution-curve-of-a-numeric-variable-according-to-a/m-p/838519#M36239</link>
      <description>&lt;P&gt;Two different methods illustrated below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data students_mod;
set students;
if missing(type_college) then type_college = 'Total';
*get date value for sorting correctly if more dates included;
*may read correctly without compress if your locale is set for your language/location;
Date = input(compress(scan(name, -1, "_"), 'i'), monyy5.);
format date monyy5.;
run;


proc sgplot data=students_mod;
series y=col1 x=date / group = type_college markers datalabel=col1;
format date monyy5.;
keylegend /position=right;
run;

proc sgplot data=students_mod;
series y=col1 x=name / group=type_college datalabel=col1 ;
keylegend /position=right;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/423900"&gt;@Child79&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Here is my dataset. I have two categorical variables (type_college and name) and a numeric variable (COL1).&lt;/P&gt;
&lt;P&gt;I don't know how to plot on the same graph the evolution curves of COL1 according to name for each type_college.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data students;
  infile datalines dlm=',' dsd;
  informat type_college $15.  name $15. ; 
input  type_college   name $  COL1 ;
datalines;
College private,delai_dec20,1.5
College private,delai_juin21,3.6
College private,delai_dec21,4.4
College private,delai_sep22,47.6
College public,delai_dec20,5.3
College public,delai_juin21,6
College public,delai_dec21,14.4
College public,delai_sep22,14.4
University,delai_dec20,11.1
University,delai_juin21,14.3
University,delai_dec21,14
University,delai_sep22,17.1
,delai_dec20,5.6
,delai_juin21,7.1
,delai_dec21,12
,delai_sep22,18.1
;&lt;/PRE&gt;
&lt;P&gt;here is exactly what I want for result.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture d’écran 2022-10-12 000900.png" style="width: 618px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76164i12B7A28D3392CB33/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture d’écran 2022-10-12 000900.png" alt="Capture d’écran 2022-10-12 000900.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2022 20:55:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-plot-evolution-curve-of-a-numeric-variable-according-to-a/m-p/838519#M36239</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-10-13T20:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot evolution curve of a numeric variable according to a categorical variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-plot-evolution-curve-of-a-numeric-variable-according-to-a/m-p/838521#M36240</link>
      <description>&lt;P&gt;If "total" is supposed to be the value for the missing university type then place a value or at least say so.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One way:&lt;/P&gt;
&lt;PRE&gt;proc format;
value $misstype  (default=15)
' ' = 'Total';
run;
proc sgplot data=students;
   series x=name y=col1/ group= type_college
                 datalabel;
   format type_college $misstype. ;
run;

&lt;/PRE&gt;
&lt;P&gt;You will find in the long run that you will much better off using actual date values instead of things that hold dates such like your delai_dec20 because there are going to be times that you need to order the values and these will not sort correctly at all.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Graphing anything with a missing value is pretty much a problem to begin with. Much better off to supply an actual value so you know where it belongs on the graph.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Details about KEYLEND and style options to control appearance are left to you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/423900"&gt;@Child79&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Here is my dataset. I have two categorical variables (type_college and name) and a numeric variable (COL1).&lt;/P&gt;
&lt;P&gt;I don't know how to plot on the same graph the evolution curves of COL1 according to name for each type_college.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data students;
  infile datalines dlm=',' dsd;
  informat type_college $15.  name $15. ; 
input  type_college   name $  COL1 ;
datalines;
College private,delai_dec20,1.5
College private,delai_juin21,3.6
College private,delai_dec21,4.4
College private,delai_sep22,47.6
College public,delai_dec20,5.3
College public,delai_juin21,6
College public,delai_dec21,14.4
College public,delai_sep22,14.4
University,delai_dec20,11.1
University,delai_juin21,14.3
University,delai_dec21,14
University,delai_sep22,17.1
,delai_dec20,5.6
,delai_juin21,7.1
,delai_dec21,12
,delai_sep22,18.1
;&lt;/PRE&gt;
&lt;P&gt;here is exactly what I want for result.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture d’écran 2022-10-12 000900.png" style="width: 618px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76164i12B7A28D3392CB33/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture d’écran 2022-10-12 000900.png" alt="Capture d’écran 2022-10-12 000900.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2022 21:11:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-plot-evolution-curve-of-a-numeric-variable-according-to-a/m-p/838521#M36240</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-10-13T21:11:12Z</dc:date>
    </item>
  </channel>
</rss>

