Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

20-PST-044 Sas Record

Download as pdf or txt
Download as pdf or txt
You are on page 1of 114

SNEHA TD

20-PST-044

Loyola College (Autonomous), Chennai-


34
PG & Research Department of Statistics

Record Work
Subject Code: PST 1504
STATISTICAL DATA ANALYSIS USING SAS
I M.Sc. Statistics
Name: SNEHA TD
Department Number: 20-PST-044

Submitted to
Prof. M. Syluvai Anthony. M.Sc, M.Phil.,

1|Page
SNEHA TD
20-PST-044

CERTIFICATE

This is to certify, that this is the bonafide record of work


done by SNEHA TD, Dept. no: 20-PST-044 in “PST1504 -
STATISTICAL DATA ANALSYSIS USING SAS”, in partial
fulfillment of the degree of Master of Science in Statistics.

__ ____________________
SNEHA TD 20-PST-044

Examiners

1. Internal Examiner ____________________

2. External Examiner ____________________

2|Page
SNEHA TD
20-PST-044

CONTENTS
Exercise TITLE
No Page No
6
1 CREATING A PERMANENT LIBRARY
7
2 CREATING A DATASET IN SAS USING DATALINES/CARDS
9
3 OBTAINING CONTENT OF A DATASET
10
4 IMPORTING AN EXCEL DATA FILE IN SAS
12
5 IMPORTING AN EXCEL FILE IN SAS
13
6 CREATING A COPY OF A DATASET
14
7 SUBSETTING A DATASET BASED ON IF CONDITION
17
8 RENAMING VARIABLES
18
9 KEEP VARIABLES
19
10 DROP VARIABLES
20
11 CREATING NEW VARIABLE USING IF ELSE STATEMENT
21
12 CREATING NEW VARIABLE USING IF ELSE IF STATEMENT
22
13 CREATING SUMMARY REPORT USING PROC MEANS
CREATING NEW VARIABLES USING MATHEMATICAL 23
14 OPERATORS
24
15 CREATING SUMMARY USING PPROC UNIVARIATE
35
16 CREATING FREQUENCY TABLE USING PROC FREQ
36
17 OBTAINING CORRELATION MATRIX USING PROC CORR
37
18 SORTING DATASET
19 38
AGGREGATING DATASET

3|Page
SNEHA TD
20-PST-044
20 39
TRANSPORTING DATASET
21 40
MULTIPLE LINEAR REGRESSION MODEL
22 46
STACKING DATASETS
23 47
MERGING DATASETS (INNER JOIN)
24 48
MERGING DATASETS (FULL OUTER JOIN)
25 49
MERGING DATASETS (LEFT OUTER JOIN)
26 50
MERGING DATASETS (RIGHT OUTER JOIN)
27 51
MERGING DATASETS (LEFT JOIN EXCLUDING INNER
JOIN)
28 52
MERGING DATASETS (RIGHT JOIN EXCLUDING INNER
JOIN)
29 53
MERGING DATASETS (FULL OUTER JOIN EXCLUDING
INNER JOIN)
30 54
REMOVAL OF DUPLICATE RECORDS
31 55
SUBSETTING USING FIRST. AND LAST.
32 57
CREATING VARIABLES USING LAG FUNCTION
33 58
SCORING A DATASET USIG REGRESSION MODEL
34 OBTAINING PREDICTED AND RESIDUALS USING OLS 62
REGRESSION MODEL
35 CHECK FOR MULTICOLLINEARITY USING VIF AND 66
CONDITIONAL INDEX
36 69
TEST FOR NORMALITY OF ERROR
37 73
MODEL SELECTION IN OLS REGRESSION
38 78
MODEL VALIDATION
39 RETAIN STATEMENT TO CREATE ROW ID AND CUMULATIVE 86
SUM
40 89
PARAMETRIC TEST-ANOVA&INDEPENDENT SAMPLE T TEST
41 93
FITTING OF DISTRIBUTION
42 98

4|Page
SNEHA TD
20-PST-044
PROC SQL- CREATING A COPY AND SORTING A DATASET
43 99
PROC SQL – SUBSETTING USING IN
44 100
PROC SQL – AGGREGATING DATASET
45 101
PROC SQL – MERGING DATASETS
46 103
PLOTTING THE TIME SERIES DATA
47 105
DIFFERENCING TO ACHIEVE STATIONARITY
48 106
FITTING OF ARIMA MODEL
49 109
FORECASTING FOR FUTURE TIME POINTS
50 111
SAS MACRO WITH INPUT ARGUMENT(S)

5|Page
SNEHA TD
20-PST-044

EXERSICE NO: 1 DATE:11/05/2020

CREATING A PERMANENT LIBRARY IN SAS

SAS CODE:

“ LIBNAME“ IS A KEYWORD THAT IS USED TO CREATE A PERMANENT LIBRARY IN SAS.

SAS LOG AND LIBRARY:

6|Page
SNEHA TD
20-PST-044

EXERCISE NO: 2 DATE: 11/10/2020

CREATING A DATASETS IN SAS USING DATALINES/CARDS

SAS CODE:

7|Page
SNEHA TD
20-PST-044

SAS LOG AND OUTPUT:

8|Page
SNEHA TD
20-PST-044

EXERCISE NO: 3 DATE:13-10-2020

‘OBTAINING CONTENT OF A DATASE’

SAS CODE:

SAS RESULT:

9|Page
SNEHA TD
20-PST-044

EXERCISE NO: 4 DATE:13-10-2020

“IMPORTING A CSV FILE IN SAS”

SAS CODE:

SAS LOG AND OUTPUT:

10 | P a g e
SNEHA TD
20-PST-044

11 | P a g e
SNEHA TD
20-PST-044

EXERCISE NO: 5 DATE: 13-10-2020

“ IMPORTING AN EXCEL DATAFILE IN SAS”

SAS CODE:

SAS LOG AND OUTPUT:

12 | P a g e
SNEHA TD
20-PST-044

EXERCISE NO:6 DATE:20-10-2020

“CREATING A COPY OF A DATASET”

CODE:

13 | P a g e
SNEHA TD
20-PST-044

LOG WINDOW:

OUTPUT WINDOW:

EXERCISE NO: 7 DATE: 23-10-2020

“SUBSETTING A DATASET BASED ON IF CONDITION”

AND STATEMENT:

(KEEP)

CODE:

14 | P a g e
SNEHA TD
20-PST-044

LOG WINDOW:

OUTPUT:

(DELETE)

CODE:

LOG WINDOW:

OUTPUT:

15 | P a g e
SNEHA TD
20-PST-044

OR STATEMENT:

(KEEP)

CODE:

LOG WINDOW:

OUTPUT:

16 | P a g e
SNEHA TD
20-PST-044

(DELETE)

CODE:

LOG WINDOW:

OUTPUT:

EXERCISE NO:8 DATE:20-10-2020

“RENAMING VARIABLES”

CODE:

17 | P a g e
SNEHA TD
20-PST-044

LOG WINDOW:

OUTPUT:

EXERCISE NO:9 DATE:21-10-2020

“KEEP VARIABLES”

CODE:

18 | P a g e
SNEHA TD
20-PST-044

LOG WINDOW:

OUTPUT WINDOW:

EXERCISE NO:10 DATE:21-10-2020

“DROP VARIABLES”

CODE:

19 | P a g e
SNEHA TD
20-PST-044

LOG WINDOW:

OUTPUT WINDOW:

EXERCISE NO:11 DATE:23-


10-2020

“CREATING NEW VARIABLE USING IF ELSE STATEMENT”

20 | P a g e
SNEHA TD
20-PST-044

CODE:

LOG WINDOW:

OUTPUT WINDOW:

EXERCISE NO:12 DATE:23-10-2020

“CREATING NEW VARIABLE USING IF ELSE IF STATEMENT”

CODE:

21 | P a g e
SNEHA TD
20-PST-044

LOG WINDOW:

OUTPUT WINDOW:

EXERCISE NO: 13 DATE: 23-10-2020

“CREATING SUMMARY REPORT USING PROC MEANS”

CODE:

22 | P a g e
SNEHA TD
20-PST-044

LOG WINDOW:

RESULT WINDOW:

EXERCISE NO: 14 DATE: 23-10-2020

“CREATING NEW VARIABLE USING MATHEMATICAL


OPERATORS”

23 | P a g e
SNEHA TD
20-PST-044

CODE:

LOG WINDOW:

OUTPUT WINDOW:

EXERCISE NO: 15 DATE:23-10-2020

“CREATING SUMMARY USING PROC UNIVARIATE”

24 | P a g e
SNEHA TD
20-PST-044

CODE:

LOG WINDOW:

RESULT:

LIMIT:

25 | P a g e
SNEHA TD
20-PST-044

26 | P a g e
SNEHA TD
20-PST-044

RATING:

27 | P a g e
SNEHA TD
20-PST-044

28 | P a g e
SNEHA TD
20-PST-044

AGE:

29 | P a g e
SNEHA TD
20-PST-044

30 | P a g e
SNEHA TD
20-PST-044

BALANCE:

31 | P a g e
SNEHA TD
20-PST-044

32 | P a g e
SNEHA TD
20-PST-044

33 | P a g e
SNEHA TD
20-PST-044

PROC UNIVARIATE is a SAS procedure for running descriptive statistics as well as


checking important assumptions of various statistical techniques such as normality,
detecting outliers, etc.

34 | P a g e
SNEHA TD
20-PST-044

EXERCISE NO: 16 DATE:23-10-2020

“CREATING FREQUENCY TABLE USING PROC FREQ”

CODE:

LOG WINDOW:

RESULT:

35 | P a g e
SNEHA TD
20-PST-044

EXERCISE NO: 17 DATE: 1-11-2020

“OBTAINING CORRELATION USING MATRIX USING PROC


CORR”

SAS CODE:

SAS LOG:

SAS RESULT:

36 | P a g e
SNEHA TD
20-PST-044

EXERCISE NO: 18 DATE: 1-11-2020

“SORTING DATASETS”

SORTING W.R.T ONE VARIABLE IN ASCENDING ORDER:

SAS CODE:

SAS LOG:

SAS OUTPUT:

37 | P a g e
SNEHA TD
20-PST-044

EXERCISE NO: 19 DATE:1-11-2020

“AGGREGRATING DATASETS”

SAS CODE:

SAS LOG:

SAS OUTPUT:

38 | P a g e
SNEHA TD
20-PST-044

EXERCISE NO: 20 DATE: 1-11-2020

“TRANSPOSING DATASET”

SAS CODE:

SAS LOG:

SAS OUTPUT:

39 | P a g e
SNEHA TD
20-PST-044

EXERCISE NO:21 DATE: 1-11-2020

“MULTIPLE LINEAR REGRESSION MODEL”

SAS CODE:

SAS LOG:

SAS RESULT:

40 | P a g e
SNEHA TD
20-PST-044

INTERPRETATION:

H0: All Bj’s =0

H1: Atleast one bj is not equal to 0

R2: R2 value is 0.7181.

i.e. 71.8% of the Total probability in Credit balance is explained by independent variables
in the model.

Overall fit of the model: The p-value is less than 0.05. It is concluded that the null
hypothesis is rejected at 5% level of significance.

i.e. Atleast one independent variable X contributes significantly to the variation in


dependent variable Y.

H0: Bj=Bj^

H1: Bj ≠ Bj^

• INTERCEPT: The p value is greater than 0.05. It is concluded that the null
hypothesis is accepted.

41 | P a g e
SNEHA TD
20-PST-044
• RATING: The p value is greater than 0.05. It is concluded that the null hypothesis
is accepted.
• LIMIT: The p value is less than 0.05. It is concluded that the null hypothesis is
rejected.
• CARDS: The p value is less than 0.05. It is concluded that the null hypothesis is
rejected.
• AGE: The p value is less than 0.05. It is concluded that the null hypothesis is
rejected.
• EDUCATION:The p value is greater than 0.05. It is concluded that the null
hypothesis is accepted.
• CUSTOMER_MALE: The p value is greater than 0.05. It is concluded that the null
hypothesis is accepted.
• STUDENT_IND: The p value is less than 0.05. It is concluded that the null
hypothesis is rejected.
• MARRIED_IND: The p value is greater than 0.05. It is concluded that the null
hypothesis is accepted.
• CAUCASIAN: The p value is greater than 0.05. It is concluded that the null
hypothesis is accepted.
• AFRICANAMERICAN: The p value is greater than 0.05. It is concluded that the null
hypothesis is accepted.

42 | P a g e
SNEHA TD
20-PST-044

43 | P a g e
SNEHA TD
20-PST-044

44 | P a g e
SNEHA TD
20-PST-044

SAS OUTPUT:

45 | P a g e
SNEHA TD
20-PST-044

EXERCISE NO: 22 DATE: 1-11-2020

“STACKING DATASETS”

SAS CODE:

SAS LOG:

SAS OUTPUT:

46 | P a g e
SNEHA TD
20-PST-044

EXERCISE NO:23 DATE: 1-11-2020

“MERGING DATASETS”

INNER JOIN:

SAS CODE:

SAS LOG:

SAS OUTPUT:

47 | P a g e
SNEHA TD
20-PST-044

EXERCISE NO: 24 DATE:1-11-202

FULL OUTER JOIN:

SAS CODE:

SAS LOG:

SAS OUTPUT:

48 | P a g e
SNEHA TD
20-PST-044

EXERCISE NO: 25

LEFT OUTER JOIN:

SAS CODE:

SAS LOG:

SAS OUTPUT:

49 | P a g e
SNEHA TD
20-PST-044

EXERCISE NO: 26

SAS CODE:

SAS LOG:

SAS OUTPUT:

50 | P a g e
SNEHA TD
20-PST-044

EXERCISE NO: 27 DATE:04-11-2020

“MERGING DATASETS (LEFT JOIN EXCLUDING INNER


JOIN)”

SAS CODE:

SAS LOG:

SAS OUTPUT:

51 | P a g e
SNEHA TD
20-PST-044

EXERCISE NO: 28 DATE: 04-11-2020

“MERGING DATASETS (RIGHT JOIN EXCLUDING INNER


JOIN)”

SAS CODE:

SAS LOG:

SAS OUTPUT:

52 | P a g e
SNEHA TD
20-PST-044

EXAMPLE NO: 29 DATE: 7-11-2020

“MERGING DATASETS (FULL OUTER JOIN EXCLUDING INNER


JOIN)”

SAS CODE:

SAS LOG:

SAS OUTPUT:

53 | P a g e
SNEHA TD
20-PST-044

EXERCISE NO: 30 DATE:07-11-2020

“REMOVAL OF DUPLICATE RECORDS”

SAS CODE:

SAS LOG:

SAS OUTPUT:

54 | P a g e
SNEHA TD
20-PST-044

EXERCISE NO: 31 DATE: 07-11-2020

“SUBSETTING USING FIRST. AND LAST.”

SUBSETTING USING FIRST.:

SAS CODE:

SAS LOG:

SAS OUTPUT:

55 | P a g e
SNEHA TD
20-PST-044

SUBSETTING USING LAST.:

SAS CODE:

SAS LOG:

SAS OUTPUT:

56 | P a g e
SNEHA TD
20-PST-044

EXERCISE NO:32 DATE: 07-11-2020

“CREATING VARIABLES USING LAG FUNCTION”

SAS CODE:

SAS LOG:

SAS OUTPUT:

57 | P a g e
SNEHA TD
20-PST-044

EXERCISE NO: 33 DATE:07-11-2020

“SCORING A DATASET USING REGRESSION MODEL”

SAS CODE:

SAS LOG:

SAS OUTPUT:

SAS RESULT:

58 | P a g e
SNEHA TD
20-PST-044

59 | P a g e
SNEHA TD
20-PST-044

60 | P a g e
SNEHA TD
20-PST-044

61 | P a g e
SNEHA TD
20-PST-044

EXERCISE NO:34 DATE:08-11-2020

“OBTAINING PREDICTED AND RESIDUALS USING OLS


REGRESSION MODEL”

SAS CODE:

SAS LOG:

SAS OUTPUT:

62 | P a g e
SNEHA TD
20-PST-044

SAS RESULT:

63 | P a g e
SNEHA TD
20-PST-044

64 | P a g e
SNEHA TD
20-PST-044

65 | P a g e
SNEHA TD
20-PST-044

EXERCISE NO:35 DATE: 08-11-2020

“CHECK FOR MULTICOLLINEARITY USING VIF AND CONDITIONAL


INDEX”

SAS CODE:

SAS RESULT:

66 | P a g e
SNEHA TD
20-PST-044

INTERPRETATION:

• vif” command produces variance inflation factors with the parameter estimates
and it is the reciprocal of tolerance.
• “collin” command produces the detailed analysis of collinearity among the
regressors.

67 | P a g e
SNEHA TD
20-PST-044
• From the parameter estimates table we can observe that the independent
variables Rating and Limit have VIF value greater than 10 which indicates that
those variables are severely affected by multicollinearity. In the collinearity
diagnostics table, large values in the condition index column indicate potential
collinearity. The condition index value for the 11th row is 167.20266 which is
greater than 30 which implies that the independent variables Rating and Limit
are involved in multi-collinear relationship since the variance proportion for
variables Rating and Limit are greater than 0.50.

68 | P a g e
SNEHA TD
20-PST-044

EXERCISE NO:36 DATE: 08-11-2020

“TEST FOR NORMALITY OF ERROR”

SAS CODE:

“qqplot” statement creates quantile-quantile plots and compares ordered variable


values with quantiles of a specified theoretical distribution.
– The Residuals follows normal distribution.
– The Residuals do not follow normal distribution.

SAS RESULT:

69 | P a g e
SNEHA TD
20-PST-044

70 | P a g e
SNEHA TD
20-PST-044

71 | P a g e
SNEHA TD
20-PST-044

INTERPRETATION:
From the Tests for Normality table we can observe the p-values of Shapiro-wilk test,
Cramer -von Mises test and Anderson-Darling test are less than 0.05 hence we reject the
null hypothesis and conclude that the residuals do not follow normal distribution.
From the pp plot and qq plot we can observe that some points are deviating from the
straight line, thus the residuals do not follow normal distribution.

72 | P a g e
SNEHA TD
20-PST-044

EXERCISE NO: 37 DATE: 23-11-2020

“MODEL SELECTION IN OLS REGRESSION”

FORWARD SELECTION:

SAS CODE:

“slentry” command specifies the significance level for entry into the model used in the
forward and stepwise selection methods.

SAS LOG:

SAS OUTPUT:

73 | P a g e
SNEHA TD
20-PST-044

INTERPRETATION:
In Forward Selection Method the independent variables significant at 5% level of
significance (i.e. Rating, student_ind, Age, Cards, Limit) enter the model.

74 | P a g e
SNEHA TD
20-PST-044

BACKWARD ELIMINATION:

SAS CODE:

“slstay” command specifies the significance level for staying in the model for the
backward and stepwise methods.

SAS LOG:

SAS OUTPUT:

75 | P a g e
SNEHA TD
20-PST-044

INTERPRETATION:
In Backward Selection Method the independent variables that are not significant at 5%
level of significance (i.e. Caucasian, AfricanAmerican, Rating, Customer_male,
Education, Married_ind) are removed from the model.

SETPWISE SELECTION:

SAS CODE:

SAS LOG:

SAS OUTPUT:

76 | P a g e
SNEHA TD
20-PST-044

INTERPRETATION:

In Stepwise Selection Method the independent variables that are significant at 5% level
of significance (i.e. student_ind, Age, Cards & Limit) enter the model and the
independent variable which is not significant at 5% level of significance (i.e. Rating) is
removed from the model.

77 | P a g e
SNEHA TD
20-PST-044

EXERCISE NO:38 DATE:24-11-2020

“MODEL VALIDATION”

DIVIDING THE DATASET USING SRS:

SAS CODE:

SAS LOG:

SAS OUTPUT:

FREQUENCY TABLE OF THE SELECTION DATASET:

78 | P a g e
SNEHA TD
20-PST-044

SAS CODE:

SAS LOG:

SAS OUTPUT:

SPLITTING THE DATASET INTO TRAIN AND TEST:

SAS CODE:

SAS LOG:

SAS OUTPUT:

79 | P a g e
SNEHA TD
20-PST-044

SAS CODE:

SAS LOG:

SAS OUTPUT:

BUILDING THE REGRESSION MODEL:

80 | P a g e
SNEHA TD
20-PST-044

SAS CODE:

SAS LOG:

SAS OUTPUT:

SCORING THE TRAIN AND TEST DATASETS:

SAS CODE:

SAS LOG:

SAS OUTPUT:

81 | P a g e
SNEHA TD
20-PST-044

SAS CODE:

SAS LOG:

SAS OUTPUT:

APE FOR TRAIN AND TEST MODEL:

SAS CODE:

82 | P a g e
SNEHA TD
20-PST-044

SAS LOG:

SAS OUTPUT:

SAS CODE:

SAS LOG:

SAS OUTPUT:

83 | P a g e
SNEHA TD
20-PST-044

SUMMARY OF APE OF TRAIN AND TEST MODEL:

SAS CODE:

SAS LOG:

SAS OUTPUT:

SAS CODE:

84 | P a g e
SNEHA TD
20-PST-044

SAS LOG:

SAS OUTPUT:

OVERALL INTERPRETATION:
We have divided the dataset into train (80%) and test (20%) data and built regression
model on both the datasets. By using “proc score”, we have scored for the two datasets
and by using “proc means”, we have calculated percentage error for train and test
datasets. Since the mean percentage error has small difference between the train and
test dataset, we can conclude that the model has good predictive power.

85 | P a g e
SNEHA TD
20-PST-044

EXERCISE NO: 39 DATE: 24-11-2020

“Retain Statement to create row id and cumulative sum”

SAS CODE:

SAS LOG:

SAS OUTPUT:

SAS CODE:

86 | P a g e
SNEHA TD
20-PST-044

SAS LOG:

SAS OUTPUT:

SAS CODE:

SAS LOG:

87 | P a g e
SNEHA TD
20-PST-044

SAS OUTPUT:

88 | P a g e
SNEHA TD
20-PST-044

EXERCISE NO:40 DATE:24-11-2020

“PARAMETRIC TEST-ANOVA & INDEPENDENT SAMPLE T


TEST”

ANOVA:
H0: There is no significant difference between the average balances towards ethnicity.
H1: There is a significant difference between the average balances towards ethnicity.

SAS CODE:

SAS OUTPUT:

89 | P a g e
SNEHA TD
20-PST-044

90 | P a g e
SNEHA TD
20-PST-044

Interpretation for ANOVA:


Since the p value is greater than 0.05 (i.e. 0.2107 > 0.05), we accept the null hypothesis.
Hence there is no significant difference between the ethnicity towards balance.

t-TEST:
H0: There is no significant difference between the average balance of a student and a
non-student.
H1: There is a significant difference between the average balance of a student and a
non-student.

SAS CODE:

SAS OUTPUT:

91 | P a g e
SNEHA TD
20-PST-044

Interpretation for t-TEST:


Since the p value is less than 0.05 (i.e. 0.0001 < 0.05), we reject the null hypothesis.
Hence there is no significant difference between the average balance of a student and a
non-student.

92 | P a g e
SNEHA TD
20-PST-044

EXERCISE NO: 41 DATE: 28-11-2020

“FITTING OF DISTRIBUTION”

SAS CODE:

SAS RESULT:

93 | P a g e
SNEHA TD
20-PST-044

94 | P a g e
SNEHA TD
20-PST-044
FITTING OF NORMAL DISTRIBUTION:

95 | P a g e
SNEHA TD
20-PST-044

FITTING OF LOGNORMAL DISTRIBUTION:

FITTING OF WEIBULL DISTRIBUTION:

FITTING OF GAMMA DISTRIBUTION:

96 | P a g e
SNEHA TD
20-PST-044

Interpretation:
From the above fitted distributions, Weibull distribution is the best fit to the given data.
Since it has lowest Cramer-von mises test statistics value among all the other
distribution

97 | P a g e
SNEHA TD
20-PST-044

EXERCISE NO: 42 DATE:28-11-2020

“PROC SQL – CREATING A COPY & SORTING A DATASET”

SAS CODE:

SAS LOG:

SAS OUTPUT:

98 | P a g e
SNEHA TD
20-PST-044

EXERCISE NO: 43 DATE: 28-11-2020

“PROC SQL – SUBSETTING USING IN”

SAS CODE:

SAS LOG:

SAS OUTPUT:

99 | P a g e
SNEHA TD
20-PST-044

EXERCISE NO: 44 DATE:28-11-2020

“PROC SQL – AGGREGATING DATASET”

SAS CODE:

SAS LOG:

SAS OUTPUT:

100 | P a g e
SNEHA TD
20-PST-044

EXERCISE NO: 45 DATE: 28-11-2020

“PROC SQL- MERGING DATASETS”


INNER JOIN:

SAS CODE:

SAS LOG:

SAS OUTPUT:

101 | P a g e
SNEHA TD
20-PST-044

LEFT JOIN:

SAS CODE:

SAS LOG:

SAS OUTPUT:

102 | P a g e
SNEHA TD
20-PST-044

EXERCISE NO: 46 DATE: 28-11-2020

“FORECASTING USING ARIMA”

Plotting the Timeseries Data:


SAS CODE:

SAS LOG:

SAS OUTPUT:

103 | P a g e
SNEHA TD
20-PST-044

104 | P a g e
SNEHA TD
20-PST-044

EXERCISE NO: 47 DATE:28-11-2020

“FORECASTING USING ARIMA”


“Differencing”

SAS CODE:

SAS OUTPUT:

105 | P a g e
SNEHA TD
20-PST-044

EXERCISE NO: 48 DATE:01-12-2020

“FITTING OF ARIMA MODEL”

SAS CODE:

SAS OUTPUT:

106 | P a g e
SNEHA TD
20-PST-044

107 | P a g e
SNEHA TD
20-PST-044

108 | P a g e
SNEHA TD
20-PST-044

EXERCISE NO:49 DATE: 01-12-2020

“FORECASTING FOR FUTURE TIME POINTS”

SAS CODE:

SAS RESULT:

SAS OUTPUT:

109 | P a g e
SNEHA TD
20-PST-044

INTERPRETATION:

We have successfully forecasted the air passengers for 12 months from NOV 2020 to OCT
2020 using the procedure “proc arima”.

110 | P a g e
SNEHA TD
20-PST-044

EXERCISE NO:50 DATE:1-12-2020

“SAS MACRO WITH INPUT ARGUMENTS”

SAS CODE:

SAS RESULT:

111 | P a g e
SNEHA TD
20-PST-044

OUTPUT DATA:

INTERPRETATION:

112 | P a g e
SNEHA TD
20-PST-044
Using “%Macro” and “%Mend” statement, we created a user defined function
“Gold_Medal_List()” to get the gold medal list for each department.

113 | P a g e
SNEHA TD
20-PST-044

114 | P a g e

You might also like