<?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 Re: Graph ideas for trend analysis in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Graph-ideas-for-trend-analysis/m-p/938611#M368660</link>
    <description>&lt;P&gt;Thanks for this, the year value represents crime per thousand. The building, traffic, space, and quality variables are all survey values (higher score is better)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 08 Aug 2024 01:02:15 GMT</pubDate>
    <dc:creator>newsas007</dc:creator>
    <dc:date>2024-08-08T01:02:15Z</dc:date>
    <item>
      <title>Graph ideas for trend analysis</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Graph-ideas-for-trend-analysis/m-p/938605#M368658</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;I am trying to get ideas for generating a trend graph by year and a few other variables (4 exactly) by a categorical variable (3 categories).&lt;/P&gt;
&lt;P&gt;the year value represents crime per thousand. The building, traffic, space, and quality variables are all survey values (higher score is better)&lt;/P&gt;
&lt;P&gt;Any cool ideas are appreciated. Thanks&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
	infile datalines dlm=',';
	input Area :$5. Year_2020 Year_2021	Year_2022 Building	Traffic	Space Quality;
datalines;
A,64,114,105,12.8,15,3.6,16.6
B,7,12,14,13.9,14.7,14.8,17.5
C,1,6,4,16.9,18.5,17,19.6
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Thu, 08 Aug 2024 01:03:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Graph-ideas-for-trend-analysis/m-p/938605#M368658</guid>
      <dc:creator>newsas007</dc:creator>
      <dc:date>2024-08-08T01:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: Graph ideas for trend analysis</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Graph-ideas-for-trend-analysis/m-p/938607#M368659</link>
      <description>&lt;P&gt;With SAS any sort of trend data will go much better with one observation per date (daily, monthly, yearly what ever).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;An approach to a basic series plot based on the time value. The data step creates one observation for the apparent category variable and time point. You didn't mention what value any of those "year" variables represented. A variable name and label to make more sense in the graph display would be a very good.&lt;/P&gt;
&lt;P&gt;Without any description of what any of Building Traffic Space Quality mean and how they would relate to a "trend" I ignore them. Some sort of meaning would be needed.&lt;/P&gt;
&lt;PRE&gt;data toplot;
   set have;
   array y(2020:2022) year_2020 Year_2021 Year_2022 ;
   do year = 2020 to 2022;
      Yearvalue = y[year];
      output;
   end;
   keep area year yearvalue;
run;


proc sgplot data=toplot;
  series x=year y=yearvalue/ group=area;
run;

&lt;/PRE&gt;
&lt;P&gt;If I knew that the year value represented something such as "price in $1,000s" a label for such could appear on the year helping someone understand what is displayed.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 22:54:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Graph-ideas-for-trend-analysis/m-p/938607#M368659</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-08-07T22:54:33Z</dc:date>
    </item>
    <item>
      <title>Re: Graph ideas for trend analysis</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Graph-ideas-for-trend-analysis/m-p/938611#M368660</link>
      <description>&lt;P&gt;Thanks for this, the year value represents crime per thousand. The building, traffic, space, and quality variables are all survey values (higher score is better)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2024 01:02:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Graph-ideas-for-trend-analysis/m-p/938611#M368660</guid>
      <dc:creator>newsas007</dc:creator>
      <dc:date>2024-08-08T01:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: Graph ideas for trend analysis</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Graph-ideas-for-trend-analysis/m-p/938614#M368661</link>
      <description>&lt;P&gt;It looks like you need Mixed Model to take into account of other independent variables (Building Traffic Space Quality) for trend analysis .&lt;/P&gt;
&lt;P&gt;Thus, better post it at Statistical Forum:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/Statistical-Procedures/bd-p/statistical_procedures" target="_blank"&gt;https://communities.sas.com/t5/Statistical-Procedures/bd-p/statistical_procedures&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
	infile datalines dlm=',';
	input Area :$5. Year_2020 Year_2021	Year_2022 Building	Traffic	Space Quality;
datalines;
A,64,114,105,12.8,15,3.6,16.6
B,7,12,14,13.9,14.7,14.8,17.5
C,1,6,4,16.9,18.5,17,19.6
;
data want;
 set have;
 array x{*} Year_2020 Year_2021	Year_2022;
 do i=1 to dim(x);
   y=x{i};time=input(scan(vname(x{i}),-1,'_'),best.);output;
 end;
 drop i Year_:;
run;
proc glimmix data=want;
class area time;
model y=Building	Traffic	Space Quality time/solution dist=poisson;
random time/residual subject=area  type=ar(1);
store out=MixedModel;
run;
proc plm restore=MixedModel;
effectplot interaction (x=time )/clm connect;;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1723082059077.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/99099i2E4FAABD8ECC995D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1723082059077.png" alt="Ksharp_0-1723082059077.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2024 01:54:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Graph-ideas-for-trend-analysis/m-p/938614#M368661</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-08-08T01:54:26Z</dc:date>
    </item>
    <item>
      <title>Re: Graph ideas for trend analysis</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Graph-ideas-for-trend-analysis/m-p/938744#M368686</link>
      <description>&lt;P&gt;Is there a 3D plot that i can perhaps use with say 2 continuous variables (Year_2022, quality) and categorical variable Area? This would be helpful&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2024 02:07:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Graph-ideas-for-trend-analysis/m-p/938744#M368686</guid>
      <dc:creator>newsas007</dc:creator>
      <dc:date>2024-08-09T02:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: Graph ideas for trend analysis</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Graph-ideas-for-trend-analysis/m-p/938745#M368687</link>
      <description>proc template;&lt;BR /&gt;define statgraph layoutoverlay3d;&lt;BR /&gt;begingraph;&lt;BR /&gt;entrytitle "Density Plot of Height and Weight";&lt;BR /&gt;layout overlay3d / tilt=10 rotate=54&lt;BR /&gt;walldisplay=none cube=false;&lt;BR /&gt;surfaceplotparm x=height y=weight z=density /&lt;BR /&gt;surfacecolorgradient=density;&lt;BR /&gt;endlayout;&lt;BR /&gt;endgraph;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;BR /&gt;proc sgrender data=sashelp.gridded template=layoutoverlay3d;&lt;BR /&gt;run;</description>
      <pubDate>Fri, 09 Aug 2024 02:14:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Graph-ideas-for-trend-analysis/m-p/938745#M368687</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-08-09T02:14:05Z</dc:date>
    </item>
    <item>
      <title>Re: Graph ideas for trend analysis</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Graph-ideas-for-trend-analysis/m-p/938746#M368688</link>
      <description>i used this code:&lt;BR /&gt;proc template;&lt;BR /&gt;define statgraph layoutoverlay3d;&lt;BR /&gt;begingraph;&lt;BR /&gt;entrytitle "Density Plot of crime and quality score";&lt;BR /&gt;layout overlay3d / tilt=10 rotate=54&lt;BR /&gt;walldisplay=none cube=false;&lt;BR /&gt;surfaceplotparm x=Year_2020 y=quality z=Area /&lt;BR /&gt;surfacecolorgradient=Area;&lt;BR /&gt;endlayout;&lt;BR /&gt;endgraph;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;BR /&gt;proc sgrender data=have template=layoutoverlay3d;&lt;BR /&gt;run;</description>
      <pubDate>Fri, 09 Aug 2024 02:26:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Graph-ideas-for-trend-analysis/m-p/938746#M368688</guid>
      <dc:creator>newsas007</dc:creator>
      <dc:date>2024-08-09T02:26:47Z</dc:date>
    </item>
    <item>
      <title>Re: Graph ideas for trend analysis</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Graph-ideas-for-trend-analysis/m-p/938749#M368689</link>
      <description>&lt;P&gt;Try this one.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And you need more data to plot 3D graph.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
	infile datalines dlm=',';
	input Area :$5. Year_2020 Year_2021	Year_2022 Building	Traffic	Space Quality;
datalines;
A,64,114,105,12.8,15,3.6,16.6
B,7,12,14,13.9,14.7,14.8,17.5
C,1,6,4,16.9,18.5,17,19.6
;

proc format;
invalue ifmt
'A'=1
'B'=2
'C'=3;
value fmt
1='A'
2='B'
3='C';
run;
data have;
 set have;
 _area=input(area,ifmt.);
 format _area fmt.;
run;
proc kde data=have;
bivar _Area Quality/ plots=all;
freq Year_2022;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1723174067806.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/99145iCB61AE17DA602B28/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1723174067806.png" alt="Ksharp_0-1723174067806.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2024 03:27:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Graph-ideas-for-trend-analysis/m-p/938749#M368689</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-08-09T03:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: Graph ideas for trend analysis</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Graph-ideas-for-trend-analysis/m-p/938751#M368690</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
	infile datalines dlm=',';
	input Area :$5. Year_2020 Year_2021	Year_2022 Building	Traffic	Space Quality;
datalines;
A,64,114,105,12.8,15,3.6,16.6
B,7,12,14,13.9,14.7,14.8,17.5
C,1,6,4,16.9,18.5,17,19.6
;

proc format;
invalue ifmt
'A'=1
'B'=2
'C'=3;
value fmt
1='A'
2='B'
3='C';
run;
data have;
 set have;
 _area=input(area,ifmt.);
 format _area fmt.;
run;
proc kde data=have;
bivar _Area Quality/out=want;
freq Year_2022;
run;


proc template;
define statgraph layoutoverlay3d;
begingraph;
entrytitle "Density Plot of Height and Weight";
layout overlay3d / tilt=10 rotate=54
walldisplay=none cube=false;
surfaceplotparm x=value1 y=value2 z=density /
surfacecolorgradient=density;
endlayout;
endgraph;
end;
run;
proc sgrender data=want template=layoutoverlay3d;
format value1 fmt.;
label value1='Area' value2='Year_2022';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1723174589048.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/99146iBEF496CF8A1BE088/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1723174589048.png" alt="Ksharp_0-1723174589048.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2024 03:36:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Graph-ideas-for-trend-analysis/m-p/938751#M368690</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-08-09T03:36:35Z</dc:date>
    </item>
  </channel>
</rss>

