Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Characterizing time series presentation
1. Characterizing Time Series Data
Using SAS
for non-regression based exploratory data analysis
Dr. Steven C. Myers
Department of Economics
College of Business Administration
The University of Akron
econdatascience.com
May 2, 2019
2. Characterizing Time Series Data
Using SAS
for non-regression based exploratory data analysis
From Silvia, et al. Economic and Business Forecasting:
analyzing and interpreting economic results. Wiley, 2014.
Chapter 6: Characterizing a Time Series Using SAS
Software (section The Data Step, especially pp. 138-140)
3. Characterizing Time Series – Graphs and Tables
Graph Plot the series – three questions
See any extreme values?
Unusual event or mistake in data
Does it have a explicit time trend?
Linear or nonlinear, increasing or decreasing and at what rate
Cyclical pattern that repeats
Is there a structural break?
Indicates a major change in behavior
Table Simple Statistics over portions of the time series
Mean = Central tendency of a series
Standard Deviation = Measure of volatility
Standard Deviation as a percentage of the mean = Stability of the series
From: Silvia, Chapter 4, repeated in “SAS-speak” in Chapter 6.
4. Graph Plot the series – three questions
See any extreme values?
Unusual event or mistake in data
Does it have a explicit time trend?
Trend? Linear or nonlinear, increasing
or decreasing and at what rate
Cyclical pattern that repeats
Is there a structural break?
Indicates a major change in behavior
Strong Productivity Growth Era
Slow Productivity Growth Era
Productivity Resurgence Era
Total series
Table Simple Statistics
over portions of the time series
Mean = Central tendency of a series
S.D. = Standard Deviation
= Measure of volatility
Standard Deviation as a percentage of the mean
= Stability of the series
Figure 4.1 and Table 4.1 from Silvia
5. The FRED Blog. Spurious Correlation. https://fredblog.stlouisfed.org/2014/07/spurious-correlation, July 28, 2014.
Time Series may rise and fall because of other series. This can result in spurious correlated relationships.
M2 and Debt appear
to be positively correlated
%∆M2 and % ∆Debt
do not appear correlated.
M2/GDP and Debt/GDP
do not appear correlated.
CREATE
(1) Divide your variable by a common
trend variable
(2) Changes and percentage changes in
your variable.
6. Data demo;
/* assume work.data contains Annual M2 and DEBT and nominal GDP */
Set work.data;
/* create changes and percentage changes in your variables */
/* first difference */
d1M2 = dif1(M2); /* if y = variable on RHS, this gives y(t)-y(t-1) */
/* use dif4 or dif12 for quarterly and monthly data */
Is Debt caused by an expanded Money Supply? A look at the spurious correlation example.
Dif1 function
y=dif1(x)
y = x(t) - x(t-1)
7. Data demo;
/* assume work.data contains M2 and DEBT and nominal GDP */
Set work.data;
/* create changes and percentage changes in your variables */
/* first difference */
d1M2 = dif1(M2); /* if y = variable on RHS, this gives y(t)-y(t-1) */
/* percentage changes */
pctd1M2 = d1M2/lag(M2); /* if y = variable on RHS, this gives [y(t)-y(t-1)]/y(t-1) */
/* use LAG4 and lag12 for quarterly and monthly data.
Is Debt caused by an expanded Money Supply?
Lag function
Y = LAG(x)
y(t) = x(t-1)
8. Data demo;
/* assume work.data contains M2 and DEBT and nominal GDP */
Set work.data;
/* create changes and percentage changes in your variables */
/* change: first difference */
d1M2 = dif1(M2); /* if y = variable on RHS, this gives y(t)-y(t-1) */
/* percentage changes */
pctd1M2 = d1M2/lag(M2); /* if y = variable on RHS, this gives [y(t)-y(t-1)]/y(t-1) */
/* detrend by using a common trend */
flatM2 = M2/GDP; /* divide by a series with the same upward trend, such as GDP */
Is Debt caused by an expanded Money Supply?
9. Data demo;
/* assume work.data contains M2 and DEBT and nominal GDP */
Set work.data;
/* create changes and percentage changes in your variables */
/* first difference */
d1M2 = dif1(M2); /* if y = variable on RHS, this gives y(t)-y(t-1) */
/* percentage changes */
pctd1M2 = d1M2/lag(M2); /* if y = variable on RHS, this gives [y(t)-y(t-1)]/y(t-1) */
/* detrend a common trend */
flatM2 = M2/GDP; /* divide by a series with the same upward trend, such as GDP */
/* do the same for Debt */
d1DEBT = dif1(DEBT);
pctd1DEBT = d1DEBT/lag(DEBT);
flatDEBT = DEBT/GDP;
Is Debt caused by an expanded Money Supply?
10. Data Division into Business Cycles
or other terms
From Silvia, et al. Economic and Business Forecasting: analyzing and interpreting economic results.
Wiley, 2014.
Chapter 6: Characterizing a Time Series Using SAS Software (The Proc Step: Calculating the Mean,
Standard Deviation and Stability Ratio of a Variable, pp. 151-153)
11. Data work.tsexp;
set work.tsexp_excel;
length group $ 5; /* length is critical – must be long enough to show all char. */
d1gdp=dif1(fygfd); /* if y = variable on RHS, this gives y(t)-y(t-1) */
pctd1gdp=d1gdp/lag(fygfd); /* if y = variable on RHS, this gives [y(t)-y(t-1)]/y(t-1) */
d1deficit=dif1(FYFSD); /* if y = variable on RHS, this gives y(t)-y(t-1) */
pctd1deficit=d1deficit/lag(FYFSD); /* if y = variable on RHS, this gives [y(t)-y(t-1)]/y(t-1) */
/* define a group for a timeslice of the time-series data for comparison */
group=‘ ‘;
if observation_date ge '1jan80'd and observation_date lt '1jan90'd then group='1980s';
if observation_date ge '1jan90'd and observation_date lt '1jan00'd then group='1990s';
if observation_date ge '1jan00'd and observation_date lt '1jan10'd then group='2000s';
if observation_date ge '1jan10'd and observation_date lt '1jan20'd then group='2010s';
run;
proc sort data=work.tsexp;
by group;
run;
12. What if you wanted to define group by the business cycle?
Change
group=‘ ‘;
if date ge '1jan80'd and date lt '1jan90'd then group='1980s';
if date ge '1jan90'd and date lt '1jan00'd then group='1990s';
if date ge '1jan00'd and date lt '1jan10'd then group='2000s';
if date ge '1jan10'd and date lt '1jan20'd then group='2010s';
To
group=‘ ‘; Length group $ 10;
/* ….. Add more as needed to cover your period of time */
/* dates shown are turning points */
if date ge '1jan80'd and date lt '1jul80'd then group=‘1-P-jan80';
if date ge '1jul80'd and date lt '1jul81'd then group=‘2-T-jul80';
if date ge '1jul81'd and date lt '1nov82'd then group=‘3-P-jul81';
if date ge '1nov82'd and date lt '1jul90'd then group=‘4-T-nov82';
if date ge '1jul90'd and date lt '1mar91'd then group=‘5-P-jul90';
if date ge '1mar91'd and date lt '1mar01'd then group=‘6-T-mar91';
if date ge '1mar01'd and date lt ‘1nov01'd then group=‘7-P-mar01';
if date ge '1nov01'd and date lt '1dec07'd then group=‘8-T-nov01';
if date ge '1dec07'd and date lt '1jun09'd then group=‘9-P-dec07';
if date ge '1jun09'd then group=’10-T-jun09';
Using date for observation_date to save space.
Business cycle dates at
https://www.nber.org/cycles/cyclesmain.html
13. Mean, Volatility and Stability
From Silvia, et al. Economic and Business Forecasting: analyzing and interpreting economic results.
Wiley, 2014.
Chapter 6: Characterizing a Time Series Using SAS Software (The Proc Step: Calculating the Mean,
Standard Deviation and Stability Ratio of a Variable, pp. 146-149)
14. Time Series Deficit Analysis Example
Contains for each series
1. SGPLOT – trend plot for variable
2. SGPLOT – Vertical Box Plot by group
(see the image and link from SAS on
the right to interpret)
3. PROC MEANS by group for
a. Mean ( 𝑥)
b. Volatility (Std. Deviation, s)
c. Stability (Coeff. Of Variation, (s/ 𝑥)*100
PROC SGPLOT
https://documentation.sas.com/?docsetId=g
rstatproc&docsetTarget=n0yjdd910dh59zn1t
oodgupaj4v9.htm&docsetVersion=9.4&local
e=en
15. Center Stability Volatility
of the of the of the
series series series
1980s 1990s 2000s 2010s
1980s 1990s 2000s 2010s
MIN 25% 50% 75% 100%
Characterizing a Time-Series with Exploratory Data Analysis
16. Focus on the Box Plot as part of Characterizing a Time-Series as Exploratory Data Analysis