Skip to content

Instantly share code, notes, and snippets.

@MJacobs1985
Created September 30, 2021 08:15
Show Gist options
  • Save MJacobs1985/bab9c247d6ac03ef027ecaf389b63071 to your computer and use it in GitHub Desktop.
Save MJacobs1985/bab9c247d6ac03ef027ecaf389b63071 to your computer and use it in GitHub Desktop.
Time-Series Analysis in SAS
/** DATA EXPLORATION **/
ods graphics / reset width=7in height=5in imagemap imagefmt=svg;
proc sgplot data=WORK.want;
series x=date y=total_all ;
series x=date y=total_male ;
series x=date y=total_female ;
xaxis label='Date' type=time grid;
yaxis label="Total Mortality" grid;
title "Total Mortality in the Netherlands over Time"; run;
ods graphics / reset width=10in height=5in imagemap imagefmt=svg;
proc sgplot data=WORK.month;
series x=date y=total_all ;
series x=date y=total_male ;
series x=date y=total_female;
xaxis label='Date' type=time grid;
yaxis label="Total Mortality" grid;
title "Total Mortality in the Netherlands over Time"; run;
ods graphics / reset width=10in height=5in imagemap imagefmt=svg;
proc sgplot data=WORK.month;
series x=date y='0_65_all'n ;
series x=date y='65_80_all'n ;
series x=date y='80_more_all'n;
xaxis label='Date' type=time grid minor;
yaxis label="Total Mortality" grid;
title "Total Mortality in the Netherlands over Time"; run;
proc sgplot data=WORK.month;
series x=date y='0_65_male'n ;
series x=date y='65_80_male'n ;
series x=date y='80_more_male'n;
xaxis label='Date' type=time grid minor;
yaxis label="Male Mortality" grid;
title "Male Mortality in the Netherlands over Time"; run;
proc sgplot data=WORK.month;
series x=date y='0_65_female'n ;
series x=date y='65_80_female'n ;
series x=date y='80_more_female'n;
xaxis label='Date' type=time grid minor;
yaxis label="Female Mortality" grid;
title "Female Mortality in the Netherlands over Time"; run;
proc sgplot data=WORK.monthlong;
where variable in ('0_65_all' '65_80_all' '80_more_all');
heatmap x=date y=Variable / name='HeatMap' discretey nxbins=100 colorresponse=Value colorstat=mean
colormodel=(CX3288BD CX99D594 CXE6F598 CXFEE08B CXFC8D59 CXD53E4F);
gradlegend 'HeatMap' / title='Death';
xaxis label='Date' type=time; yaxis label="Category" fitpolicy=thin;
title "Death over time by category"; run;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment