Beruflich Dokumente
Kultur Dokumente
Submitted by:
NPM : 1411021055
To :
Universitas Lampung
2016
1
FOREWORD
Alhamdulillah, Praise our utter gratitude over the presence of God Almighty
for the blessings of his grace, and we can sort the paper properly and on time. In this
paper we discuss about some of the strategies being the Manager of a company and
the procedures for programming via the SAS portable.
Thus, this paper may be useful for the readers, because the existence of this
paper, readers can understand and gain knowledge about SAS.
I realize that in writing this paper are still many shortcomings, therefore we
strongly expect criticism and constructive suggestions.
Compiler
2
TABLE OF CONTENTS
COVER........................................................................................................................1
FOREWORD................................................................................................................2
TABLE OF CONTENTS..............................................................................................3
INTRODUCTION
1. Background.......................................................................................................5
2. Problem Formulation........................................................................................5
3. The Purpose Of The Writing............................................................................6
TOPIC
1. The Influence of Characteristics of Students on Exam Marks.........................
A. Without Principal Component Regression...........................................
B. With Principal Component Regression................................................
2. The Demand Forecast of Airplanes of Sriwijaya Air Based on its Market
Share.................................................................................................................
A. Stepar Method.......................................................................................
B. Exponential Smoothings Method.........................................................
C. Winter Method......................................................................................
D. Add-Winter Method..............................................................................
3. The Unrestricted and Restricted Demand Function of Dancow Baby Milk ....
A. Low Income..........................................................................................
B. Midle Income........................................................................................
C. High Income.........................................................................................
4. Management Science........................................................................................
A. Portfolio Selection................................................................................
B. Financial Mix Strategy.........................................................................
C. Marketing Strategy...............................................................................
D. Manpower Planning..............................................................................
E. Audit Staff Managements.....................................................................
5. Price Competition: Alfamart, Indomart, and Warung.......................................
A. Cochrane-Cox.......................................................................................
6. The Computations of Disparity........................................................................
A. Generalized Entrophy...........................................................................
B. Atkinson Index ....................................................................................
C. Gini Index.............................................................................................
7. Loan Procedure.................................................................................................
A. Fixed Rate Loans..................................................................................
B. Ballon Payment Loans..........................................................................
C. Adjustable Rate Loans..........................................................................
D. Buydown Rate Loans............................................................................
8. Project Evaluations Under Certainty and Uncertainty.....................................
CLOSING
Conclusion....................................................................................................................
REFERENCES.............................................................................................................
3
INTRODUCTION
1. Background
SAS (Statistical Analysis System). As the name implies, this SAS software is
one of the software used by the statistical data analyzer, which is of course critical for
many things.
SAS is very important to learn because Nearly all matters relating to finasial
companies, such as profit expectations, predictions of losses, the company's
4
prospects, as well as all matters relating to the element number in a company can be
done by processing statistical data in SAS software's ,
SAS is a software that is often used by companies and certain agencies, which
will certainly make statistical calculations become easier and Counting statistics will
also be much easier and faster thereby saving time.
we need to learn SAS to facilitate our work in the company after graduation.
2. Problem Formulation
3. Purpose
5
TOPIC
87 21 83 M 2 80
83 19 80 M 1 100
85 23 86 M 4 98
81 21 75 F 1 76
81 21 75 F 3 82
67 20 68 F 3 99
75 26 88 F 2 102
92 24 78 F 4 115
78 26 92 M 4 126
89 30 95 F 3 129
72 21 80 F 1 86
81 19 65 M 2 80
75 17 77 M 1 70
76 19 85 F 1 99
80 35 83 F 3 99
6
75 27 60 F 2 60
85 21 80 M 3 89
79 27 75 M 4 70
90 21 93 F 3 140
97 22 95 M 3 165
90 21 82 M 2 115
87 19 86 F 3 119
95 32 90 M 2 120
68 19 57 F 3 89
EDITOR
Data indri;
Input exam_mark age paper_mark sex year_in_college iq @@;
DATALINES;
87 21 83 M 2 80
83 19 80 M 1 100
85 23 86 M 4 98
81 21 75 F 1 76
81 21 75 F 3 82
67 20 68 F 3 99
75 26 88 F 2 102
92 24 78 F 4 115
78 26 92 M 4 126
89 30 95 F 3 129
72 21 80 F 1 86
81 19 65 M 2 80
75 17 77 M 1 70
76 19 85 F 1 99
80 35 83 F 3 99
75 27 60 F 2 60
85 21 80 M 3 89
79 27 75 M 4 70
90 21 93 F 3 140
97 22 95 M 3 165
90 21 82 M 2 115
87 19 86 F 3 119
95 32 90 M 2 120
68 19 57 F 3 89
;
7
RUN;
TITLE='Pie Chart Discrete';
proc gchart data=indri;
pie year_in_college/discrete value=inside percent=inside
slice=outside;
run;
RESULT
GRAPH1 WORK.GSEG.GCAHRT
This pie chart is explain about frequency of student that spending their time until can
finishing their study . in here we can see that many student finish their study at 9 as
37,50% (blue colour) ; 6 as 25,00% (gren colour); 5 as 20,83% (red colour) and the
last is 4 as 16,67% (tosca colour).
8
EDITOR
data indri;
input exam_mark age pape_mark sex year_in_college iq @@;
datalines;
87 21 83 M 2 80
83 19 80 M 1 100
85 23 86 M 4 98
81 21 75 F 1 76
81 21 75 F 3 82
67 20 68 F 3 99
75 26 88 F 2 102
92 24 78 F 4 115
78 26 92 M 4 126
89 30 95 F 3 129
72 21 80 F 1 86
81 19 65 M 2 80
75 17 77 M 1 70
76 19 85 F 1 99
80 35 83 F 3 99
75 27 60 F 2 60
85 21 80 M 3 89
79 27 75 M 4 70
90 21 93 F 3 140
97 22 95 M 3 165
90 21 82 M 2 115
87 19 86 F 3 119
95 32 90 M 2 120
68 19 57 F 3 89
;
Title='IQ data of indri';
ods graphics ods graphics off;
proc univariate data=indri
noprint;
histogram Iq;
Run;
RESULT
GRAPH1 WORK.GSEG.UNIVAR
9
C. Make a scatter plot with IQ on the x-axis and exam grade on the y-axis
EDITOR
DATA indri;
INPUT exam_mark age paper_mark sex year_in_college IQ @@;
DATALINES;
87 21 83 1 2 80
83 19 80 1 1 100
85 23 86 1 4 98
81 21 75 0 1 76
81 21 75 0 3 82
67 20 68 0 3 99
75 26 88 0 2 120
92 24 78 0 4 115
78 26 92 1 4 126
89 30 95 0 3 129
72 21 80 0 1 86
81 19 65 1 2 80
75 17 77 1 1 70
76 19 85 0 1 99
80 35 83 0 3 99
75 27 60 0 2 60
85 21 80 1 3 89
79 27 75 1 4 70
90 21 93 0 3 140
97 22 95 1 3 165
90 21 82 1 2 115
87 19 86 0 3 119
95 32 90 1 2 120
10
68 19 57 0 3 89
;
PROC PLOT DATA=indri;
plot exam_mark*IQ;
RUN;
RESULT
The SAS System
11:20 Thursday, June 18, 2016 1
Plot of exam_mark*IQ. Legend: A = 1 obs, B = 2 obs, etc.
exam_mark
97 A
96
95 A
94
93
92 A
91
90 A A
89 A
88
87 A A
86
85 A A
84
83 A
82
81 A A A
80 A
79 A
78 A
77
76 A
75 A A A
74
73
72 A
71
70
69
68 A
67 A
60 70 80 90 100 110 120 130 140 150 160 170
IQ
D. Make a scatter plot with sex on the x-axis and IQ on the y-axis
EDITOR
DATA indri;
INPUT exam_mark age paper_mark sex year_in_college IQ @@;
DATALINES;
87 21 83 1 2 80
83 19 80 1 1 100
85 23 86 1 4 98
81 21 75 0 1 76
81 21 75 0 3 82
67 20 68 0 3 99
75 26 88 0 2 120
92 24 78 0 4 115
78 26 92 1 4 126
89 30 95 0 3 129
72 21 80 0 1 86
81 19 65 1 2 80
75 17 77 1 1 70
11
76 19 85 0 1 99
80 35 83 0 3 99
75 27 60 0 2 60
85 21 80 1 3 89
79 27 75 1 4 70
90 21 93 0 3 140
97 22 95 1 3 165
90 21 82 1 2 115
87 19 86 0 3 119
95 32 90 1 2 120
68 19 57 0 3 89
;
RUN;
title='Scatter Plot Sex and IQ';
proc plot data=indri;
plot IQ*sex;
RUN;
RESULT
12
B
60 A
0 1
Sex
IQ
EDITOR
options nodate pageno=1 linesize=80 pagesize=60;
data indri;
INPUT exam_mark age paper_mark sex year_in_college IQ @@;
DATALINES;
87 21 83 1 2 80
83 19 80 1 1 100
85 23 86 1 4 98
81 21 75 0 1 76
81 21 75 0 3 82
67 20 68 0 3 99
75 26 88 0 2 120
92 24 78 0 4 115
78 26 92 1 4 126
89 30 95 0 3 129
72 21 80 0 1 86
81 19 65 1 2 80
75 17 77 1 1 70
76 19 85 0 1 99
80 35 83 0 3 99
75 27 60 0 2 60
85 21 80 1 3 89
13
79 27 75 1 4 70
90 21 93 0 3 140
97 22 95 1 3 165
90 21 82 1 2 115
87 19 86 0 3 119
95 32 90 1 2 120
68 19 57 0 3 89
;
proc means data=indri maxdec=3;
var IQ;
class sex;
types sex;
title 'Means of IQ for Male and Female';
run;
RESULT
Analysis Variable : IQ
N
EDITOR
DATA indri;
INPUT exam_mark age paper_mark sex $
year_in_college IQ @@;
If IQ>=100 then mutu="1";
else mutu="0";
cards;
87 21 83 m 2 80
83 19 80 m 1 100
85 23 86 m 4 98
81 21 75 f 1 76
81 21 75 f 3 82
67 20 68 f 3 99
75 26 88 f 2 120
92 24 78 f 4 115
78 26 92 m 4 126
89 30 95 f 3 129
72 21 80 f 1 86
14
81 19 65 m 2 80
75 17 77 m 1 70
76 19 85 f 1 99
80 35 83 f 3 99
75 27 60 f 2 60
85 21 80 m 3 89
79 27 75 m 4 70
90 21 93 f 3 140
97 22 95 m 3 165
90 21 82 m 2 115
87 19 86 f 3 119
95 32 90 m 2 120
68 19 57 f 3 89
;
proc print data=indri;
run;
RESULT
1 87 21 83 m 2 80 0
2 83 19 80 m 1 100 1
3 85 23 86 m 4 98 0
4 81 21 75 f 1 76 0
5 81 21 75 f 3 82 0
6 67 20 68 f 3 99 0
7 75 26 88 f 2 120 1
8 92 24 78 f 4 115 1
9 78 26 92 m 4 126 1
10 89 30 95 f 3 129 1
11 72 21 80 f 1 86 0
12 81 19 65 m 2 80 0
13 75 17 77 m 1 70 0
14 76 19 85 f 1 99 0
15 80 35 83 f 3 99 0
16 75 2 60 f 2 60 0
17 85 21 80 m 3 89 0
18 79 27 75 m 4 70 0
19 90 21 93 f 3 140 1
20 97 22 95 m 3 165 1
21 90 21 82 m 2 115 1
22 87 19 86 f 3 119 1
23 95 32 90 m 2 120 1
24 68 19 57 f 3 89 0
15
EDITOR
options nodate pageno=1 linesize=80 pagesize=60;
data indri;
INPUT exam_mark age paper_mark sex year_in_college IQ @@;
if sex='F' then mutu='0';
else mutu='1';
cards;
87 21 83 1 2 80
83 19 80 1 1 100
85 23 86 1 4 98
81 21 75 0 1 76
81 21 75 0 3 82
67 20 68 0 3 99
75 26 88 0 2 120
92 24 78 0 4 115
78 26 92 1 4 126
89 30 95 0 3 129
72 21 80 0 1 86
81 19 65 1 2 80
75 17 77 1 1 70
76 19 85 0 1 99
80 35 83 0 3 99
75 27 60 0 2 60
85 21 80 1 3 89
79 27 75 1 4 70
90 21 93 0 3 140
97 22 95 1 3 165
90 21 82 1 2 115
87 19 86 0 3 119
95 32 90 1 2 120
68 19 57 0 3 89
;
proc print data=indri;
run;
RESULT
The SAS System 1
1 87 21 83 1 2 80 1
2 83 19 80 1 1 100 1
3 85 23 86 1 4 98 1
4 81 21 75 0 1 76 1
5 81 21 75 0 3 82 1
6 67 20 68 0 3 99 1
7 75 26 88 0 2 120 1
8 92 24 78 0 4 115 1
9 78 26 92 1 4 126 1
16
10 89 30 95 0 3 129 1
11 72 21 80 0 1 86 1
12 81 19 65 1 2 80 1
13 75 17 77 1 1 70 1
14 76 19 85 0 1 99 1
15 80 35 83 0 3 99 1
16 75 27 60 0 2 60 1
17 85 21 80 1 3 89 1
18 79 27 75 1 4 70 1
19 90 21 93 0 3 140 1
20 97 22 95 1 3 165 1
21 90 21 82 1 2 115 1
22 87 19 86 0 3 119 1
23 95 32 90 1 2 120 1
24 68 19 57 0 3 89 1
H. Regresi Biasa
EDITOR
data Exam_Mark;
input Exam_Mark Age paper_mark sex year_in_collage IQ;
Cards;
87 21 83 1 2 80
83 19 80 1 1 100
85 23 86 1 4 98
81 21 75 0 1 76
81 21 75 0 3 82
67 20 68 0 3 99
75 26 88 0 2 120
92 24 78 0 4 115
78 26 92 1 4 126
89 30 95 0 3 129
72 21 80 0 1 86
81 19 65 1 2 80
75 17 77 1 1 70
76 19 85 0 1 99
80 35 83 0 3 99
75 27 60 0 2 60
85 21 80 1 3 89
79 27 75 1 4 70
90 21 93 0 3 140
97 22 95 1 3 165
90 21 82 1 2 115
87 19 86 0 3 119
95 32 90 1 2 120
68 19 57 0 3 89
;
proc reg data=Exam_Mark;
model Exam_Mark=Age paper_mark sex year_in_collage IQ/ VIF;
run;
RESULT
17
Number of Observations Read 24
Number of Observations Used 24
Analysis of Variance
Sum of Mean
Source DF Squares Square F Value Pr > F
Parameter Estimates
EDITOR
DATA Exam Mark;
INPUT Y X1 X2 X3 X4 X5; /*Regresi Komponen Utama dengan Y= Exam Mark X1= Age
X2= Paper Mark X3= Sex X4= Year in College X5= IQ ,untuk mengatasi
multikolinieritas sehingga VIF=1 */
CARDS;
87 21 83 1 2 80
83 19 80 1 1 100
85 23 86 1 4 98
81 21 75 0 1 76
81 21 75 0 3 82
67 20 68 0 3 99
75 26 88 0 2 120
92 24 78 0 4 115
78 26 92 1 4 126
89 30 95 0 3 129
72 21 80 0 1 86
81 19 65 1 2 80
75 17 77 1 1 70
76 19 85 0 1 99
80 35 83 0 3 99
75 27 60 0 2 60
85 21 80 1 3 89
79 27 75 1 4 70
90 21 93 0 3 140
97 22 95 1 3 165
90 21 82 1 2 115
87 19 86 0 3 119
95 32 90 1 2 120
68 19 57 0 3 89
18
;
Title 'KOMPONEN UTAMA';
proc princomp out=KU;
var X1 X2 X3 X4 X5 ;
run;
data komp;
merge KU;
run;
run;
RESULT
KOMPONEN UTAMA
20:41 Thursday, June 11, 2016 1
Observations 24
Variables 5
Simple Statistics
X1 X2 X3 X4 X5
Correlation Matrix
X1 X2 X3 X4 X5
19
5 0.17861240 0.0357 1.0000
Eigenvectors
KOMPONEN UTAMA
20:41 Thursday, June 11, 2016 2
Analysis of Variance
Sum of Mean
Source DF Squares Square F Value Pr > F
KOMPONEN UTAMA
20:41 Thursday, June 11, 2016 3
Durbin-Watson D 2.454
Number of Observations 24
1st Order Autocorrelation -0.257
A. Stepar Method
Tahun Permintaan Tiket
2006 35562000
2007 38359000
2008 41446000
20
2009 43442000
2010 49707000
2011 58338000
2012 70021000
EDITOR
data SRIWIJAYA;
input YEAR PASS;
cards;
2006 35562000
2007 38359000
2008 41446000
2009 43442000
2010 49707000
2011 58338000
2012 70021000
;
proc forecast data=SRIWIJAYA out=b method=stepar
trend=2 outactual out1step outlimit lead=5;
var YEAR PASS;
proc print data=b;
title 'The Forecast of Indonesian Passanger Flights From Proc
Forecast Stepar
Method';
run;
RESULT
21
Tahun Forecast Actual persentase Simpangan
2006 31882571.43 35562000.00 -11.5405 -0,32548
2007 37296714.29 38359000.00 -2.8482
2008 42710857.14 41446000.00 2.9614
2009 48125000.00 43442000.00 9,7309
2010 53539142.86 49707000.00 7,1576
2011 58953285.71 58338000.00 1,0436
2012 64367428.57 70021000.00 -8,7832
2013 75195714.29 -
2014 75195714.29 -
2015 80609857.14 -
2016 86024000.00 -
2017 91438142.86 -
SUM -2,2784
= -11.5405
2007 = 37296714.29-38359000.00/37296714.29*100
= -2.8482
2008 = 42710857.14-41446000.00/42710857.14*100
= 2.9614
2009 = 48125000.00-43442000.00/48125000.00*100
= 9,73090
2010 = 53539142.86-49707000.00/53539142.86*100
= 7,157647
2011 = 58953285.71-58338000.00/58953285.71*100
= 1,0436
2012 = 64367428.57-70021000.00/64367428.57*100
= -8,7832
EDITOR
data SRIWIJAYA;
input YEAR PASS;
Cards;
2006 35562000
2007 38359000
2008 41446000
2009 43442000
2010 49707000
2011 58338000
2012 70021000
22
;
proc forecast method=expo trend=2 weight=.1
data=SRIWIJAYA out=b outactual outlstep outlimit lead=5;
proc print data=b;
title 'The Output Forecast from PROC FORECAST The Expo method';
run;
RESULT
SUM -2,696
2006 = 31882571.43-35562000.00/31882571.43*100
23
= -11,5405
2007 = 38032600.00-38359000.00/38032600.00*100
= -0,8582
2008 = 43548817.14-41446000.00/43548817.14*100
= 4,8286
2009 = 48582454.86-43442000.00/48582454.86*100
= 10,5808
2010 = 52987536.86-49707000.00/52987536.86*100
= 6,1911
2011 = 57713197.91-58338000.00/57713197.91*100
= -1,0825
2012 = 63187121.38-70021000.00/63187121.38*100
= -10,8153
C. Winters Method
EDITOR
data SRIWIJAYA;
input YEAR PASS;
cards;
2006 35562000
2007 38359000
2008 41446000
2009 43442000
2010 49707000
2011 58338000
2012 70021000
;
proc forecast data=SRIWIJAYA out=b method=winters interval=year
trend=2 outactual out1step outlimit interval=year lead=5;
var YEAR PASS;
proc print data=b;
title The Output Forecast of Indonesian Passanger Flights From PROC FORECAST:
WINTERS Method;
run;
RESULT
24
6 FORECAST 0 2008 43255186.52
7 ACTUAL 0 2009 43442000.00
8 FORECAST 0 2009 48506226.75
9 ACTUAL 0 2010 49707000.00
10 FORECAST 0 2010 53357179.29
11 ACTUAL 0 2011 58338000.00
12 FORECAST 0 2011 58316733.30
13 ACTUAL 0 2012 70021000.00
14 FORECAST 0 2012 63664129.20
15 FORECAST 1 2013 69751243.88
16 L95 1 2013 61136660.01
17 U95 1 2013 78365827.74
18 FORECAST 2 2014 75167245.84
19 L95 2 2014 66494181.42
20 U95 2 2014 83840310.27
21 FORECAST 3 2015 80583247.81
22 L95 3 2015 71840517.18
23 U95 3 2015 89325978.45
24 FORECAST 4 2016 85999249.78
25 L95 4 2016 77174887.48
26 U95 4 2016 94823612.09
27 FORECAST 5 2017 91415251.75
28 L95 5 2017 82496587.18
29 U95 5 2017 100333916.33
SUM -1,7755
2006 = 31882571,43-35562000,00/31882571,43*100
= -11,5405
2007 = 37726171,40-38359000,00/37726171,40*100
= -1,6774
2008 = 43255186,52-41446000,00/43255186,52*100
= 4,1825
2009 = 48506226,75-43442000,00/48506226,75*100
= 10,4403
2010 = 53357179,29-49707000,00/53357179,29*100
= 6,8410
2011 = 58316733,30-58338000,00/58316733,30*100
25
= -0,0364
2012 = 63664129,20-70021000,00/63664129,20*100
= -9,9850
EDITOR
data SRIWIJAYA;
input YEAR PASS;
cards;
2006 35562000
2007 38359000
2008 41446000
2009 43442000
2010 49707000
2011 58338000
2012 70021000
;
proc forecast data=SRIWIJAYA out=b method=addwinters interval=year
trend=2 outactual out1step outlimit interval=year lead=5;
var YEAR PASS;
proc print data=b;
title 'The Output Forecast of Indonesian Passanger Flights From PROC FORECAST:
ADDWINTERS Method';
run;
RESULT
The Output Forecast of Indonesian Passanger Flights From PROC FORECAST:
ADDWINTERS Method 1
20:46 Thursday, June 13, 2016
26
28 L95 5 2017 82496587.18
29 U95 5 2017 100333916.33
SUM -1,7755
2006 = 31882571,43-35562000,00/31882571,43*100
= -11,5405
2007 = 37726171,40-38359000,00/37726171,40*100
= -1,6774
2008 = 43255186,52-41446000,00/43255186,52*100
= 4,1825
2009 = 48506226,75-43442000,00/48506226,75*100
= 10,4403
2010 = 53357179,29-49707000,00/53357179,29*100
= 6,8410
2011= 58316733,30-58338000,00/58316733,30*100
= -0,0364
2012 = 63664129,20-70021000,00/63664129,20*100
= -9,9850
From the above calculation results obtained by value deviation of less than
1%, which means that long-term forecasting methods stepar, exponential smoothings
and winters are well used to predict the number of requests for flight tickets future
periods.
deviation value stepar = -0,32548
deviation value exponential smoothing = -0,3851
deviation value winters = -0,2536
deviation value Add-winters = -0,2536
To Compare which of the three methods of long-term forecasting The Stepar,
The Expo, The Winters and The Add-Winters who has the best projection, viewable
comparison deviation value respectively. wherein the method has the smallest
deviation value among others, the method that is best used to project in this amount
of demand for air tickets future periods.
In this case the best method to use is the exponential smoothing method,
because it has the smallest deviation.
27
3. The Restricted Demand Function Of Baby Milk
The following table is a data request baby milk . Y is expressed as the number of
infant milk Dancow requested in units box ( 800gr ) . X1 is Dancow toddler milk
prices . X2 is the price of other brands of milk substitute products in units of dollars .
X3 is a complementary product in units of dollars . And X4 is income in units of
dollars .
Obs Y X1 X2 X3 X4
1 4 58500 56000 57000 3000000
2 4 58000 56000 55000 1000000
3 4 58000 56000 50000 1000000
4 4 58000 56000 50000 1700000
5 4 58000 56000 57000 700000
6 4 58000 56000 50000 700000
7 4 58000 56000 50000 700000
8 5 58000 56000 55000 6000000
9 4 57500 56000 50000 2700000
10 4 58500 56000 50000 1600000
11 4 58500 56000 50000 1400000
12 4 58500 56000 57000 1000000
13 4 58500 56000 50000 1000000
14 4 58500 56000 50000 1400000
15 4 58500 56500 55000 1600000
16 4 58500 56500 57000 3000000
17 4 57500 56500 50000 2700000
18 4 57500 56500 50000 2500000
19 8 57500 56500 57000 5000000
20 4 57500 56500 50000 2700000
21 4 57500 56500 55000 1000000
22 4 57500 56500 50000 700000
23 4 57500 56500 57000 6000000
24 4 57500 56500 50000 3000000
25 5 57500 56000 57000 2700000
26 4 57500 56000 50000 1000000
27 4 58500 56000 50000 1600000
28 4 58500 56000 55000 4500000
29 4 58000 56000 50000 2400000
30 4 58500 56000 55000 1000000
31 3 58500 56000 50000 1000000
32 4 58500 56000 57000 700000
33 4 58500 56000 50000 3000000
34 4 58500 56000 55000 2800000
35 8 58500 56000 50000 3000000
28
36 4 58000 56000 55000 1400000
37 4 58000 56000 50000 1600000
38 4 58000 56000 50000 1600000
39 4 58000 56000 57000 1800000
40 4 58000 56000 50000 1800000
41 4 58000 56500 50000 2500000
42 7 58000 56500 55000 2700000
43 4 58000 56500 50000 6000000
44 4 58000 56500 50000 1000000
45 4 58000 56500 57000 700000
46 4 58500 56500 50000 700000
47 4 58500 56500 55000 1000000
48 3 58500 56500 50000 500000
49 4 58500 56500 50000 3000000
50 4 58500 56500 57000 2700000
51 4 58500 56500 50000 1600000
52 4 58500 56500 50000 1600000
53 5 58500 56500 55000 2200000
54 4 58500 56500 55000 2700000
55 4 58500 56500 57000 3000000
56 4 58500 56500 50000 3000000
57 4 58500 56500 55000 1000000
58 4 58500 56000 57000 1400000
59 4 58500 56000 50000 1400000
60 3 58500 56000 55000 700000
61 4 58500 56000 50000 700000
62 4 58500 56000 57000 1500000
63 4 58500 56000 50000 1400000
64 4 57500 56000 50000 1700000
65 4 58500 56000 50000 1800000
66 5 58500 56000 50000 2600000
67 4 58500 56000 50000 2500000
68 4 58500 56000 50000 5000000
69 5 58500 56000 55000 6000000
70 4 57500 56000 50000 3000000
71 4 58500 56000 57000 1500000
72 4 58500 56000 50000 1500000
73 4 58500 56000 50000 700000
74 4 58500 56000 50000 1000000
75 4 58000 56500 57000 1000000
76 5 58500 56500 50000 1400000
77 5 58500 56500 50000 1600000
78 4 58500 56500 50000 6000000
79 5 58500 56000 57000 1600000
80 10 58500 57000 50000 6000000
81 4 58500 56500 55000 2700000
82 5 58500 56500 50000 1600000
83 5 57500 56500 50000 6000000
29
84 6 58500 57000 57000 6000000
85 4 58500 57000 50000 1500000
86 4 58500 57000 55000 700000
87 4 58500 57000 50000 2000000
88 4 58000 57000 57000 500000
89 4 58000 57000 50000 1600000
90 4 58500 56500 50000 1000000
91 4 58500 57000 57000 1000000
92 4 58500 56000 50000 1500000
93 4 58000 57000 55000 600000
94 4 58500 57000 50000 700000
95 8 58500 56000 50000 3000000
96 4 58500 57000 57000 1400000
97 4 58500 57000 50000 1600000
98 4 57500 57000 50000 1800000
99 4 58500 56000 57000 500000
100 4 58500 57000 50000 500000
101 4 58500 56000 50000 1000000
102 4 58500 57000 50000 500000
103 4 58000 56000 55000 3000000
104 4 58500 46500 50000 5000000
105 4 58500 46500 50000 2000000
106 3 58500 57000 57000 1500000
107 4 58500 57000 50000 6000000
108 4 58000 46500 50000 1500000
109 4 58500 56000 50000 700000
110 4 58500 56000 57000 3000000
111 4 58500 57000 50000 1000000
112 4 58500 57000 50000 1500000
113 4 58500 57000 55000 4000000
114 4 58500 57000 50000 750000
115 4 58000 57000 55000 2500000
116 8 58500 57000 50000 1800000
117 4 58500 57000 50000 1000000
118 4 58500 57000 50000 2500000
119 4 58500 57000 57000 1400000
120 4 58500 56000 50000 1400000
121 4 58500 56000 57000 1000000
122 4 58500 56000 55000 1000000
123 4 58500 56000 50000 1500000
124 4 58500 57000 50000 1000000
125 4 58500 57000 57000 1600000
126 4 58000 57000 50000 500000
127 4 57500 57000 50000 500000
128 8 58500 57000 50000 1500000
30
Once the data is collected , the first step that must be done is to group revenues ( X4 )
ranging from the lowest to the highest income using Excel. Data - Sort .
obs Y X1 X2 X3 X4
48 3 58500 56500 50000 500000
88 4 58000 57000 57000 500000
99 4 58500 56000 57000 500000
100 4 58500 57000 50000 500000
102 4 58500 57000 50000 500000
126 4 58000 57000 50000 500000
127 4 57500 57000 50000 500000
93 4 58000 57000 55000 600000
5 4 58000 56000 57000 700000
6 4 58000 56000 50000 700000
7 4 58000 56000 50000 700000
22 4 57500 56500 50000 700000
32 4 58500 56000 57000 700000
45 4 58000 56500 57000 700000
46 4 58500 56500 50000 700000
60 3 58500 56000 55000 700000
61 4 58500 56000 50000 700000
73 4 58500 56000 50000 700000
86 4 58500 57000 55000 700000
94 4 58500 57000 50000 700000
109 4 58500 56000 50000 700000
114 4 58500 57000 50000 750000
2 4 58000 56000 55000 1000000
3 4 58000 56000 50000 1000000
12 4 58500 56000 57000 1000000
13 4 58500 56000 50000 1000000
21 4 57500 56500 55000 1000000
26 4 57500 56000 50000 1000000
30 4 58500 56000 55000 1000000
31 3 58500 56000 50000 1000000
44 4 58000 56500 50000 1000000
47 4 58500 56500 55000 1000000
57 4 58500 56500 55000 1000000
74 4 58500 56000 50000 1000000
75 4 58000 56500 57000 1000000
90 4 58500 56500 50000 1000000
91 4 58500 57000 57000 1000000
101 4 58500 56000 50000 1000000
111 4 58500 57000 50000 1000000
117 4 58500 57000 50000 1000000
121 4 58500 56000 57000 1000000
122 4 58500 56000 55000 1000000
31
124 4 58500 57000 50000 1000000
11 4 58500 56000 50000 1400000
14 4 58500 56000 50000 1400000
36 4 58000 56000 55000 1400000
58 4 58500 56000 57000 1400000
59 4 58500 56000 50000 1400000
63 4 58500 56000 50000 1400000
76 5 58500 56500 50000 1400000
96 4 58500 57000 57000 1400000
119 4 58500 57000 57000 1400000
120 4 58500 56000 50000 1400000
62 4 58500 56000 57000 1500000
71 4 58500 56000 57000 1500000
72 4 58500 56000 50000 1500000
85 4 58500 57000 50000 1500000
92 4 58500 56000 50000 1500000
106 3 58500 57000 57000 1500000
108 4 58000 46500 50000 1500000
112 4 58500 57000 50000 1500000
123 4 58500 56000 50000 1500000
128 8 58500 57000 50000 1500000
10 4 58500 56000 50000 1600000
15 4 58500 56500 55000 1600000
27 4 58500 56000 50000 1600000
37 4 58000 56000 50000 1600000
38 4 58000 56000 50000 1600000
51 4 58500 56500 50000 1600000
52 4 58500 56500 50000 1600000
77 5 58500 56500 50000 1600000
79 5 58500 56000 57000 1600000
82 5 58500 56500 50000 1600000
89 4 58000 57000 50000 1600000
97 4 58500 57000 50000 1600000
125 4 58500 57000 57000 1600000
4 4 58000 56000 50000 1700000
64 4 57500 56000 50000 1700000
39 4 58000 56000 57000 1800000
40 4 58000 56000 50000 1800000
65 4 58500 56000 50000 1800000
98 4 57500 57000 50000 1800000
116 8 58500 57000 50000 1800000
87 4 58500 57000 50000 2000000
105 4 58500 46500 50000 2000000
53 5 58500 56500 55000 2200000
29 4 58000 56000 50000 2400000
18 4 57500 56500 50000 2500000
41 4 58000 56500 50000 2500000
67 4 58500 56000 50000 2500000
32
115 4 58000 57000 55000 2500000
118 4 58500 57000 50000 2500000
66 5 58500 56000 50000 2600000
9 4 57500 56000 50000 2700000
17 4 57500 56500 50000 2700000
20 4 57500 56500 50000 2700000
25 5 57500 56000 57000 2700000
42 7 58000 56500 55000 2700000
50 4 58500 56500 57000 2700000
54 4 58500 56500 55000 2700000
81 4 58500 56500 55000 2700000
34 4 58500 56000 55000 2800000
1 4 58500 56000 57000 3000000
16 4 58500 56500 57000 3000000
24 4 57500 56500 50000 3000000
33 4 58500 56000 50000 3000000
35 8 58500 56000 50000 3000000
49 4 58500 56500 50000 3000000
55 4 58500 56500 57000 3000000
56 4 58500 56500 50000 3000000
70 4 57500 56000 50000 3000000
95 8 58500 56000 50000 3000000
103 4 58000 56000 55000 3000000
110 4 58500 56000 57000 3000000
113 4 58500 57000 55000 4000000
28 4 58500 56000 55000 4500000
19 8 57500 56500 57000 5000000
68 4 58500 56000 50000 5000000
104 4 58500 46500 50000 5000000
8 5 58000 56000 55000 6000000
23 4 57500 56500 57000 6000000
43 4 58000 56500 50000 6000000
69 5 58500 56000 55000 6000000
78 4 58500 56500 50000 6000000
80 10 58500 57000 50000 6000000
83 5 57500 56500 50000 6000000
84 6 58500 57000 57000 6000000
107 4 58500 57000 50000 6000000
Having already sorted , open the application SAS 9.1.3 Portable . We will do the
Restricted and Unrestricted Demand Demand function Function .
This is the way SAS programming :
EDITOR
data milk;
input obs y x1 x2 x3 x4;
label
obs = ' observation '
33
y = ' number of boxes of milk consumption per month '
x1 = ' price formula per box '
x2 = ' price of goods substitutes '
x3 = ' prices of complementary goods '
x4 = ' monthly cash income ' ;
lny=log(y);
lnx1=log(x1);
lnx2=log(x2);
lnx3=log(x3);
lnx4=log(x4);
cards;
3 58500 56500 50000 500000
34
4 58000 56500 57000 1000000
35
4 58500 57000 50000 1600000
36
4 58500 57000 55000 4000000
RESULT
37
Number of Observations Used 64
Analysis of Variance
Sum of Mean
Source DF Squares Square F Value Pr > F
Parameter Estimates
Parameter Standard
Variable DF Estimate Error t Value Pr > |t|
Analysis of Variance
Sum of Mean
Source DF Squares Square F Value Pr > F
38
In just a few seconds we obtain the results as above . Can be in the know that the
observation amounted to 64 with the dependent variable is income . It contained the
variation analysis . F value of 2.41 , PR > F at 0.0591 . The variation coefficient of
0.58347 .
SEGMENT DATA
Such data are raw data that have not been grouped into sequential data . With SAS ,
we will classify into three groups . The first, low-income groups . The second ,
middle-income groups . And the third is with high incomes .
SAS program :
EDITOR
data milk;
input y $ x1 $ x2 $ x3 $ x4;
if x4<=2000000 then class='low';
else if x4<=4000000 then class='medium';
else class='high';
cards;
39
4 57500 56000 50000 2700000
40
4 58000 56500 57000 700000
41
4 58500 56500 55000 2700000
42
4 58500 57000 50000 1000000
;
proc sort data=milk;
by x4;
run;
proc print data=milk;
run;
RESULT
Obs y x1 x2 x3 x4 class
43
37 4 58500 57000 57000 1000000 low
38 4 58500 56000 50000 1000000 low
39 4 58500 57000 50000 1000000 low
40 4 58500 57000 50000 1000000 low
41 4 58500 56000 57000 1000000 low
42 4 58500 56000 55000 1000000 low
43 4 58500 57000 50000 1000000 low
44 4 58500 56000 50000 1400000 low
45 4 58500 56000 50000 1400000 low
46 4 58000 56000 55000 1400000 low
47 4 58500 56000 57000 1400000 low
48 4 58500 56000 50000 1400000 low
49 4 58500 56000 50000 1400000 low
50 5 58500 56500 50000 1400000 low
51 4 58500 57000 57000 1400000 low
52 4 58500 57000 57000 1400000 low
Obs y x1 x2 x3 x4 class
44
The SAS System
15:25 Thursday, June 12, 2016 3
Obs y x1 x2 x3 x4 class
Just one click " Run " we can know where a low income , whichever is higher , and
where middle-income .
4. Management Science
A. Portfolio Selection
EDITOR
title'PORTOFOLIO SELECTION';
data SAS;
input X1 X2 X3 X4 X5 _TYPE_$_RHS_;
CARDS;
0.073 0.103 0.064 0.075 0.045 MAX .
1 1 1 1 1 = 100000
1 1 . . . <= 50000
. . 1 1 . <= 50000
. . -0.25 -0.25 1 >= 0
-0.6 0.4 . . . <= 0
;
PROC LP;
RUN;
RESULT
PORTOFOLIO SELECTION
16:30 Thursday, June 11, 2016 1
45
The LP Procedure
Problem Summary
Non-negative 5
Slack 3
Surplus 1
Total 9
Constraints Number
LE 3
EQ 1
GE 1
Objective 1
Total 6
PORTOFOLIO SELECTION
16:30 Thursday, June 11, 2016 2
The LP Procedure
Solution Summary
Terminated Successfully
Phase 1 Iterations 0
Phase 2 Iterations 4
Phase 3 Iterations 0
Integer Iterations 0
Integer Solutions 0
Initial Basic Feasible Variables 7
Time Used (seconds) 0
Number of Inversions 3
Epsilon 1E-8
Infinity 1.797693E308
Maximum Phase 1 Iterations 100
Maximum Phase 2 Iterations 100
Maximum Phase 3 Iterations 99999999
Maximum Integer Iterations 100
Time Limit (seconds) 120
PORTOFOLIO SELECTION
16:30 Thursday, June 11, 2016 3
The LP Procedure
Variable Summary
Variable Reduced
46
Col Name Status Type Price Activity Cost
PORTOFOLIO SELECTION
16:30 Thursday, June 11, 2016 4
The LP Procedure
Constraint Summary
EDITOR
title'MIX STRATEGY';
data SAS;
input X1 X2 X3 X4 _TYPE_$_RHS_;
CARDS;
8 6.5 20 17 MAX .
12 12 25 25 <= 2500
1 1 2 2 <= 150
50 . 100 . <= 3000
. 50 . 100 <= 10000
1 1 . . >= 50
. . 1 1 >= 25
-8 45 -20 86 <= 3000
;
PROC LP;
RUN;
RESULT
MIX STRATEGY
16:32 Thursday, June 11, 2016 1
The LP Procedure
Problem Summary
47
Objective Function Max _OBS1_
Rhs Variable _RHS_
Type Variable _TYPE_
Problem Density (%) 35.06
Variables Number
Non-negative 4
Slack 5
Surplus 2
Total 11
Constraints Number
LE 5
GE 2
Objective 1
Total 8
MIX STRATEGY
16:32 Thursday, June 11, 2016 2
The LP Procedure
Solution Summary
Terminated Successfully
Epsilon 1E-8
Infinity 1.797693E308
Maximum Phase 1 Iterations 100
Maximum Phase 2 Iterations 100
Maximum Phase 3 Iterations 99999999
Maximum Integer Iterations 100
Time Limit (seconds) 120
MIX STRATEGY
16:32 Thursday, June 11, 2016 3
The LP Procedure
Variable Summary
Variable Reduced
Col Name Status Type Price Activity Cost
48
1 X1 BASIC NON-NEG 8 50 0
2 X2 NON-NEG 6.5 0 0
3 X3 BASIC NON-NEG 20 5 0
4 X4 BASIC NON-NEG 17 40.697674 0
5 _OBS2_ BASIC SLACK 0 757.55814 0
6 _OBS3_ BASIC SLACK 0 8.6046512 0
7 _OBS4_ SLACK 0 0 -0.239535
8 _OBS5_ BASIC SLACK 0 5930.2326 0
9 _OBS6_ SURPLUS 0 0 -2.395349
10 _OBS7_ BASIC SURPLUS 0 20.697674 0
11 _OBS8_ SLACK 0 0 -0.197674
MIX STRATEGY
16:32 Thursday, June 11, 2016 4
The LP Procedure
Constraint Summary
C. Marketing Strategy
EDITOR
title'MARKETING STRATEGY';
data SAS;
input X1 X2 X3 _TYPE_$RHS_;
CARDS;
90 70 84 MAX .
10 18 8 <= 5000
2.5 3 3 <= 1200
1 1 1 <= 600
. 1 . >= 100
;
PROC LP;
RUN;
RESULT
MARKETING STRATEGY
16:48 Thursday, June 11, 2016 1
The LP Procedure
Problem Summary
49
Objective Function Max _OBS1_
Rhs Variable _RHS_
Type Variable _TYPE_
Problem Density (%) 50.00
Variables Number
Non-negative 3
Slack 3
Surplus 1
Total 7
Constraints Number
LE 3
GE 1
Objective 1
Total 5
MARKETING STRATEGY
16:48 Thursday, June 11, 2016 2
The LP Procedure
Solution Summary
Terminated Successfully
Phase 1 Iterations 1
Phase 2 Iterations 3
Phase 3 Iterations 0
Integer Iterations 0
Integer Solutions 0
Initial Basic Feasible Variables 6
Time Used (seconds) 0
Number of Inversions 3
Epsilon 1E-8
Infinity 1.797693E308
Maximum Phase 1 Iterations 100
Maximum Phase 2 Iterations 100
Maximum Phase 3 Iterations 99999999
Maximum Integer Iterations 100
Time Limit (seconds) 120
MARKETING STRATEGY
16:48 Thursday, June 11, 2016 3
The LP Procedure
Variable Summary
Variable Reduced
Col Name Status Type Price Activity Cost
50
3 X3 BASIC NON-NEG 84 100 0
4 _OBS2_ SLACK 0 0 -6
5 _OBS3_ SLACK 0 0 -12
6 _OBS4_ BASIC SLACK 0 160 0
7 _OBS5_ SURPLUS 0 0 -74
MARKETING STRATEGY
16:48 Thursday, June 11, 2016 4
The LP Procedure
Constraint Summary
D. Manpower Planning
EDITOR
title'MANPOWER';
data SAS;
input X1 X2 b1 b2 b3 b4 _TYPE_$_RHS_;
CARDS;
1 0.9 . . . . MAX .
0.07 0.1 -1 . . . <= .
0.05 0.084 . -1 . . <= .
0.1 0.067 . . -1 . <= .
0.01 0.025 . . . -1 <= .
. . 1 . . . <= 1000
. . . 1 . . <= 970
. . . . 1 . <= 800
. . . . . 1 <= 435
. . 1 1 . . <= 1400
. . . . 1 1 <= 935
;
PROC LP;
RUN;
RESULT
MANPOWER
16:58 Thursday, June 11, 2016 1
The LP Procedure
Problem Summary
51
Problem Density (%) 18.75
Variables Number
Non-negative 6
Slack 10
Total 16
Constraints Number
LE 10
Objective 1
Total 11
MANPOWER
16:58 Thursday, June 11, 2016 2
The LP Procedure
Solution Summary
Terminated Successfully
Objective Value 0
Phase 1 Iterations 0
Phase 2 Iterations 4
Phase 3 Iterations 0
Integer Iterations 0
Integer Solutions 0
Initial Basic Feasible Variables 12
Time Used (seconds) 0
Number of Inversions 3
Epsilon 1E-8
Infinity 1.797693E308
Maximum Phase 1 Iterations 100
Maximum Phase 2 Iterations 100
Maximum Phase 3 Iterations 99999999
Maximum Integer Iterations 100
Time Limit (seconds) 120
MANPOWER
16:58 Thursday, June 11, 2016 3
The LP Procedure
Variable Summary
Variable Reduced
Col Name Status Type Price Activity Cost
1 X1 DEGEN NON-NEG 1 0 0
2 X2 NON-NEG 0.9 0 -0.528571
3 b1 DEGEN NON-NEG 0 0 0
4 b2 DEGEN NON-NEG 0 0 0
52
5 b3 DEGEN NON-NEG 0 0 0
6 b4 ALTER NON-NEG 0 0 0
7 _OBS2_ SLACK 0 0 -14.28571
8 _OBS3_ ALTER SLACK 0 0 0
9 _OBS4_ ALTER SLACK 0 0 0
10 _OBS5_ DEGEN SLACK 0 0 0
11 _OBS6_ SLACK 0 0 -14.28571
12 _OBS7_ BASIC SLACK 0 970 0
13 _OBS8_ BASIC SLACK 0 800 0
14 _OBS9_ BASIC SLACK 0 435 0
15 _OBS10_ BASIC SLACK 0 1400 0
16 _OBS11_ BASIC SLACK 0 935 0
MANPOWER
16:58 Thursday, June 11, 2016 4
The LP Procedure
Constraint Summary
1 _OBS1_ OBJECTVE . 0 0 .
2 _OBS2_ LE 7 0 0 14.285714
3 _OBS3_ LE 8 0 0 0
4 _OBS4_ LE 9 0 0 0
5 _OBS5_ LE 10 0 0 0
6 _OBS6_ LE 11 0 0 14.285714
7 _OBS7_ LE 12 970 0 0
8 _OBS8_ LE 13 800 0 0
9 _OBS9_ LE 14 435 0 0
10 _OBS10_ LE 15 1400 0 0
11 _OBS11_ LE 16 935 0 0
EDITOR
title'AUDIT STAFF ASIGNMENT';
data SAS;
input X11 X12 X13 X21 X22 X23 X31 X32 X33 X41 X42 X43
_TYPE_$_RHS_;
CARDS;
53
150 210 270 170 230 220 180 230 225 160 240
230 MIN
1 . . 1 . . 1 . . 1 . . =1
. 1 . . 1 . . 1 . . 1 . =1
. . 1 . . 1 . . 1 . . 1 =1
1 1 1 . . . . . . . . .
<=1
. . . 1 1 1 . . . . . .
<=1
. . . . . . 1 1 1 . . .
<=1
. . . . . . . . . 1 1 1
<=1
;
PROC LP;
RUN;
RESULT
Constraints Number
LE 2
EQ 1
Objective 1
Total 4
Objective Value 0
Phase 1 Iterations 0
Phase 2 Iterations 1
Phase 3 Iterations 0
Integer Iterations 0
Integer Solutions 0
Initial Basic Feasible Variables 5
54
Time Used (seconds) 0
Number of Inversions 3
Epsilon 1E-8
Infinity 1.797693E308
Maximum Phase 1 Iterations 100
Maximum Phase 2 Iterations 100
Maximum Phase 3 Iterations 99999999
Maximum Integer Iterations 100
Time Limit (seconds) 120
Variable Reduced
Col Name Status Type Price Activity Cost
1 _OBS1_ OBJECTVE . 0 0 .
2 _OBS2_ EQ . 0 0 210
3 _OBS3_ LE 13 0 0 0
4 _OBS4_ LE 14 0 0 0
55
Malkist 135g 8000 8000 8000
Pucuk harum 450ml 5800 5000 4500
Ekonomi putih 3300 3700 4000
M-150 5600 6500 5000
Teh gelas cup 1175 1400 1000
Larutan cap kaki tiga 320ml 6100 4300 6000
Mint chewy 5500 5200 6000
Indofood sambal pedas 140ml 5900 5600 6000
Kecap abc 135ml 7800 8020 8000
Simas palmia 200gr 4600 4500 4500
Mizone 50ml 5300 5400 5500
Indomie goreng 2100 5020 2300
Indomie ayam special 2250 2300 2500
Pop mie ayam 4500 4500 4500
Indomilk coklat 9100 9100 9500
Bendera kental manis 9500 9500 10000
Teh bendera 3500 3500 4000
Lifeboy body shop 2800 2800 2500
Pepsodent 75gr 3700 4000 3500
Mami poko 15500 14500 17000
Sinzui body shop 4300 3200 4000
Rexona 16300 16500 15000
Fanta 250ml 6800 6800 7000
Ceres 90gr 10300 8900 10500
Philips 8w 36100 36600 37000
Philips 18w 47800 46800 50000
Sedap cup 4500 4000 4500
Mie sedap goreng 2100 2250 2300
EDITOR
options linesize=10;
data price;
input store $ price @@;
cards;
i 3600 i 7200 i 8500 i 6000 i 8700 i 6300 i 8000 i 5000 i 3700 i 6500 i 1500 i
4300 i 5200 i 5600 i 8020 i 4500 i 5400 i 2050 i 2300 i 4500 i 9100 i 9500 i
3500 i 2800 i 4000 i 14500 i 3200 i 16500 i 6800 i 8900 i 36600 i 46800 i 4000 i
2250
a 3300 a 7500 a 8800 a 4950 a 8900 a 6400 a 8000 a 5800 a 3300 a 5600 a 1175 a
6100 a 5500 a 5900 a 7800 a 4600 a 5300 a 2100 a 2250 a 4500 a 9100 a 9500 a
3500 a 2800 a 3700 a 15500 a 4300 a 16300 a 6800 a 10300 a 36100 a 47800 a 4500 a
2100
;
PROC TTEST COCHRAN;
CLASS store;
56
VAR price;
TITLE 'difference in the price set by the Indomart and Alfamart Bandar
Lampung';
run;
RESULT
difference in the price set by the Indomart and Warung Bandar Lampung
1
16:27 Thursday, June 12, 2016
Statistics
T-Tests
Equality of Variances
Ho= M1-M2=Do
Ha=M1-M2<Do
T value > 0,05 not real
T value < 0,05 real
But our research get value of t is 0.6 so the difference isnt real. If in the view of the
SAS calculations, there is no difference in the prices, but no such difference was not
seen when only the list price only.
EDITOR
options linesize=10;
data price;
input store $ price @@;
cards;
i 3600 i 7200 i 8500 i 6000 i 8700 i 6300 i 8000 i 5000 i 3700 i 6500 i 1500 i
4300 i 5200 i 5600 i 8020 i 4500 i 5400 i 2050 i 2300 i 4500 i 9100 i 9500 i
3500 i 2800 i 4000 i 14500 i 3200 i 16500 i 6800 i 8900 i 36600 i 46800 i 4000 i
2250
w 4000 w 9000 w 9000 w 5000 w 9000 w 6500 w 8000 w 4500 w 4000 w 5000 w 1000 w
6000 w 6000 w 6000 w 8000 w 4500 w 5500 w 2300 w 2500 w 4500 w 9500 w 10000 w
4000 w 2500 w 3500 w 17000 w 4000 w 15000 w 7000 w 10500 w 37000 w 50000 w 4500 w
2300
;
PROC TTEST COCHRAN;
CLASS store;
VAR price;
TITLE 'difference in the price set by the Indomart and Warung Bandar Lampung';
run;
57
RESULT
difference in the price set by the Alfamart and Warung Bandar Lampung
1
16:29 Thursday, June 12, 2016
Statistics
T-Tests
Equality of Variances
Ho= M1-M2=Do
Ha=M1-M2<Do
T value > 0,05 not real
T value < 0,05 real
But our research get value of t is -0.09 so the difference is real. If in the view of the
SAS calculations, there is difference in the prices.
B. Atkinson
58
Where is a parameter of inequality, with a value of 0 < <1. The larger value
of , the greater the inequality.
C. Gini Coefficient:
Gini coefficient value lies between 0 and 1. Increasingly close to 1 its happen
the inequality is widening. In addition three measuring instruments above,
others measuring are using World Bank criteria. Expressed a high level of
equity income, if 40% of low-income residents receiving 12% of total
revenue.
As for measuring poverty, there are three indicators that can be seen, there are
the incidence of poverty (H ratio), the depth of poverty (poverty gap index) is
based on distance Poverty Index, and the severity of poverty (distributionally
sensitive index) is based on index severity of Poverty. From the above
rationale, appears Sen Poverty Index, which uses the Gini coefficient and the
ratio of H.
if any of these factors increases, the poverty rate would be getting bigger.
No Nama Pendapatan
1 Indri 10000000
2 Anas 5000000
3 Nur 15000000
4 Yusuf 8000000
5 Nisa 7000000
6 Hamdan 12000000
7 Zaki 20000000
8 Siti 30000000
9 Ika 11000000
10 Ifan 6500000
EDITOR
data income;
59
input y;
cards;
10000000
5000000
15000000
8000000
7000000
12000000
20000000
30000000
11000000
6500000
;
run;
proc iml;
use income;
read all var {y} into y1;
n=nrow(y1);
ry1=y1[:];
y2=y1/ry1;
alpha=8;
y3=y2##alpha;
ry3=y3[:];
y5=ry3-1;
y6=1/(alpha##2-alpha);
GE=y5*y6;
print GE; /****Generalized Entropy****/
/*****hitung Atkinson******/
epsilon=0.1;
b=1-epsilon;
c=(1/b);
y7=y2##b;
y8=y7[:];
y9=y8##c;
Atkinson=1-y9;
print Atkinson; /****Atkinson****/
/******hitung Gini***/
tot1=0;
tot2=0;
do i= 1 to n;
y=y1[i,1];
tot1=tot1+y;
w=(n+1-i)*y;
tot2=tot2+w;
end;
60
Gini= 1/n*(n+1-2*(tot2/tot1));
print GINI;
quit;
RESULT
GE
2.1013279
ATKINSON
0.0145805
GINI
0.1016064
From SAS data above, value of GE is getting closer to 4 is 2.10. and Atkinson and
Gini value closer to 1, ie 0.014 shows width of income gap in the area. So based on
samples taken from 10 income people in the Tulang Bawang Barat, proved that gap
that occurred in Indonesia has been increasingly widened.
7. Loan Procedure
EDITOR
proc loan start=2014:12;
run;
RESULT
61
BANK EKA, Fixed Rate
The initial period of the loan is at the end of the period of December 2014 and
December 2026. The fall in monthly installments of Rp.1.500.876,77, the interest
rate used is the effective interest rate or rill in the amount of 16.0755%, which for 12
years a total of Rp .116.262.53,58.
EDITOR
proc loan start=2014:12;
ballonpayment=(18=1000000 46=500000)
run;
RESULT
The SAS System
62
Downpayment 0.00 Principal Amount 100000000.00
JUN2016 1000000.00
OCT2018 500000.00
EDITOR
proc loan start=2014 : 12;
caps=(1, 5)
run;
RESULT
The SAS System
63
BANK EKA, Adjustable Rate
installment payments by Adjustable Rate Loan has increased every year due to higher
interest rates both in nominal and effective interest rate of 1%. in January 2020
installment payment reaches Rp.1.776.058,68 exceeding installment loan repayment
model with fixed rate loan of Rp.1.500.876,77.
D. Buydown Rate Loans
in December 2014 I borrowed money in the bank Eka amounting Rp 100,000,000
with interest rate of 15% for 12 years / 144 months, and stated that the interest rate
will rise to 16% and 17% at month 23 and month 46. rate nominal interest is lower
than the interest rate on a fixed rate of 1% interest due has been paid at the beginning
of the loan period.
EDITOR
proc loan start=2014:12;
buydown amount=100000000 rate=15 life=144
buydownrate=(23=16 46=17) pointpct=1
label='BANK EKA, Buydown';
run;
RESULT
The SAS System
23:36 Thursday, June 12, 2016 1
The LOAN Procedure
Buydown Loan Summary
64
Initialization 0.00 Points 1000000.00
The calculation above reflects that there are two interest rate adjustments premises
installment loan payments per month. in month, which falls on November 23, 2016
installment loan of Rp.1.559.019,08 buydown payments through interest rate
increases to 16%. whereas in the month to 46, which falls on October 2018 the
number of installment payment loan buydown be Rp.1.610.039,13 through interest
rate increases to 17%. in november 2016 installment loan payments exceed buydown
installment payment of the entire alternative models other loans.
3. Select Help
4. then SAS Help and Documentation
5. Then the display will appear as below:
65
6. Choose Search, then the following display will appear, and then type '
evaluation ' in the search box
From the information above, we can know that to perform the evaluation
using the SAS can use The DTREE Procedure or PROC DTREE. Then with
the same steps in the search for Evaluation, we look for the Sas PROC
DTREE Help. We gati ' Evaluation ' be ' PROC ' DTREE
The image above is the display of search results through the program SAS PROC
DTREE Help. It can be seen that Evaluation is included in the discussion part of the
66
PROC DTREE. From the information above, it has also provided a variety of
examples to be able to better understand the Evaluation through the PROC DTREE.
This time we took the example 3.3 on the issue of supply contracts.
Probabilit
Outcome Cost
y
Expensive $4500 0.4
Moderate $2500 0.5
Inexpensive $1000 0.1
There is also uncertainty whether he will win a contract or not. He estimated the
probability distribution won a contract as shown in Table 7.34.
Table 7.34
Events
Win the
Givens Contract
Lose the Contract
Build
Prototype
High Bid 0.4 0.6
Build
Prototype
Low Bid 0.8 0.2
No
Prototype
High Bid 0.2 0.8
No
Prototype
Low Bid 0.7 0.3
In addition, gifts from business deals is influenced by the cost of building the
prototype. Table 7.35 shows his gifts. The first row of the table shows the results if
67
he loses the contract, regardless of whether he membangunatau not build a prototype
and whether the offer is low or high
States Actions
Result Cost Bid low Bid high
Lose the Contract 0 0
Production manager must decide whether to build a prototype and the submission of
the offer. He uses the DTREE PROC to help him to make this decision. The structure
of the model is stored in = data collection STAGEIN named Stage3 Tuesday. There
are two stages of the decision, ' Choose ' and ' Bid ', and two-stage opportunities, '
Cost_Prototype ' and the ' Contract '. ' Choose ' was the decision to build or not to
build the prototype. ' Cost_Prototype ' is a definite cost to build the prototype. This
can be ' expensive ' if the cost of $ 4500, or ' Being ', if a fee of $ 2,500, or ' cheap ', if
it costs $ 1000. The ' Bid ' is the decision as to whether high or low bid bid. Lastly,
the ' Contract ', is the result, either win or lose the contract.
data Stage3;
datalines;
. . No_Prototype Bid .
. . Low_Bid Contract .
Contract C Win_Contract . .
. . Lose_Contract . .
68
The PROBIN= data set, named Prob3, contains the probability information as in
Table 7.33 and Table 7.34.
data Prob3;
datalines;
. . Expensive 0.4
. . Moderate 0.5
. . Inexpensive 0.1
The gift contains information such as the results in table 7.35. Note that the results of
' Lose_Contract ' does not exist in the collection of data Payoff3. PROC DTREE
provides default values for all of the scenarios that are not in the rewards.
data Payoff3;
_VALUE_ dollar8.0;
datalines;
69
Win_Contract Inexpensive High_Bid $85,000
goptions ctext=black;
/* -- define title -- */
graphics
nowarning
evaluate;
hsymbol=3 ftext=swiss
quit;
70
With information from PROC DTREE above, the production manager can choose
the optimal bidding strategies:
- He has to build a prototype to bid and always high bid unless the costs to
build the prototype is as low as $ 1000. The optimal strategy is forecast to
generate a refund of $ 25,850.
- If not building prototype, better decisions is to make low bids. In this case
the expected return is $ 24,500.
1. TRANSPORTATION PROBLEM
71
The transportation problem described in the "Getting Started" section is solved next.
The cost data are stored in the following SAS data set. The solution is stored in a
SAS data set as shown in Output 8.1.1 and displayed with PROC PRINT.
50 75 89 8 27 39 64 100 50 8 . .
20 58 121 70 193 60 74 213 218 54 10 Atlanta
58 20 92 94 174 118 71 185 173 57 150 Chicago
121 92 20 87 83 172 163 94 102 149 90 Denver
70 94 87 20 137 96 142 154 189 122 27 Houston
193 174 83 137 20 223 245 34 95 230 80 Los_Ange
60 118 172 96 233 20 109 259 273 92 26 Miami
74 71 163 142 245 109 20 257 240 20 80 New_York
213 185 94 164 34 259 257 20 67 244 25 San_Fran
218 173 102 189 95 273 240 67 20 232 7 Seattle
54 59 149 122 230 92 20 244 232 20 15 Washingt
;
After this program executes, the following message is written to the SAS log:
NOTE: Optimal Solution total = 22928.
Because the first observation is associated with the demands, the TAILNODE value
is _DEMAND_. If you had specified DEMAND=d, the dth observation would have
contained demand information. The last observation has a TAILNODE value of
72
_DUAL_, and the values of the HEADNODE variables are the dual variables at the
destination nodes, or the marginal costs of increasing demand at a destination node.
The other observations in the OUT= data set contain the optimal flows. For example,
the third observation contains information associated with the Chicago source node.
The values of the HEADNODE variables in this observation give the optimal flow
between Chicago and each destination node. To achieve the minimum cost, the
Chicago supply must be sent to four destinations: 30 units to Atlanta, 75 units to
Chicago, 2 units to Denver, and 43 units to Seattle. The SUPPLY variable has the
supply capability of this source node (150 units).
The _DUAL_ variable value (-13) for Chicago is the amount the total solution cost
would increase (because of the negative sign, in this case, the total cost would
decrease by $13) if Chicago supplies an extra unit of flow. (If you were to increase
the supply of Chicago to 151 and rerun PROC TRANS, specifying the
NOTHRUNET option, the total cost would change from 22928 to 22915.)
%put &_ORTRANS;
The following message is written to the SAS log:
STATUS=SUCCESSFUL OBJECTIVE=22928
73
In this example, the optimal flow is found on a capacitated transportation network.
Suppose that there are upper bounds on the amount that can be shipped within each
city. The following SAS program and output show how this capacity constraint is
included in the model:
title 'Capacitated Transportation Network';
data capcty;
input Atlanta Chicago Denver Houston Los_Ange Miami
New_York San_Fran Seattle Washingt city$;
datalines;
10 . . . . . . . . . Atlanta
. 60 . . . . . . . . Chicago
. . 100 . . . . . . . Denver
. . . 10 . . . . . . Houston
. . . . 30 . . . . . Los_Ange
. . . . . 20 . . . . Miami
. . . . . . 75 . . . New_York
. . . . . . . 25 . . San_Fran
. . . . . . . . 10 . Seattle
. . . . . . . . . 10 Washingt
;
proc print;
run;
After this program executes, the following message is written to the SAS log:
NOTE: Optimal Solution Total = 24036.
The preceding statements produce the SAS data set in Output 8.2.1.
74
Note that the optimal objective value is greater in the capacitated network (24036)
than in the uncapacitated network (22928). Additional constraints can never decrease
the objective value of a minimization problem at optimality. Also observe that the
flow within Chicago, Miami, and San_Fran are at their limits. The rerouting of flow
within these cities accounts for the increase in cost.
This example shows how PROC ASSIGN can be used to maximize an objective
function. Consider a construction project that consists of nine jobs. Because of the
nature of the project, each job must be performed by a different subcontractor. Each
job is bid upon by twelve subcontractors. The matrix that follows shows the expected
profit to the contractor if each job is given to each subcontractor. Each row in the
matrix represents a different job, and each column represents a different
subcontractor.
SUBCONTRACTOR 1 2 3 4 5 6 7 8 9 10 11 12
________________________________________________
JOB1 | 79 24 13 53 47 66 85 17 92 47 46 13
JOB2 | 43 59 33 95 55 97 34 55 84 94 26 56
JOB3 | 29 52 0 27 13 33 0 11 71 86 6 76
JOB4 | 88 83 64 72 0 67 27 47 83 62 35 38
JOB5 | 65 90 56 62 53 91 48 23 6 89 49 33
JOB6 | 44 79 86 93 71 7 86 59 0 56 45 59
JOB7 | 35 51 -9 91 39 32 3 12 79 25 79 81
JOB8 | 50 12 59 32 23 64 20 94 97 14 11 97
JOB9 | 25 17 39 . 38 63 87 14 4 18 11 45
The negative profit in the third column means that if job 7 is awarded to
subcontractor 3, the contractor loses money. The missing value in the fourth column
means that subcontractor 4 did not bid on job 9. PROC ASSIGN treats a missing
value differently from the way it treats a 0. While it is possible that an optimal
assignment could include a 0 (or even a negative) contribution to profit, the missing
value is never included in an assignment. In this case, subcontractor 4 is never
awarded job 9, regardless of the profit structure.
You can use PROC ASSIGN to find how the contractor should award the jobs to the
subcontractors to maximize his profit. First, put the data in a SAS data set. Then, call
PROC ASSIGN using the MAXIMUM option.
75
title 'Assigning Subcontractors to Construction Jobs';
data profit;
input job $ subcon1-subcon12;
datalines;
JOB1 79 24 13 53 47 66 85 17 92 47 46 13
JOB2 43 59 33 95 55 97 34 55 84 94 26 56
JOB3 29 52 0 27 13 33 0 11 71 86 6 76
JOB4 88 83 64 72 0 67 27 47 83 62 35 38
JOB5 65 90 56 62 53 91 48 23 6 89 49 33
JOB6 44 79 86 93 71 7 86 59 0 56 45 59
JOB7 35 51 -9 91 39 32 3 12 79 25 79 81
JOB8 50 12 59 32 23 64 20 94 97 14 11 97
JOB9 25 17 39 . 38 63 87 14 4 18 11 45
;
proc assign maximum data=profit;
cost subcon1-subcon12;
id job;
run;
proc print;
sum _fcost_;
run;
This means that the contractor can expect a profit of $814 if he follows the optimal
assignment.
Note that three subcontractors, SUBCON5, SUBCON8, and SUBCON11, are not
assigned to any jobs.
76
B. Example 2.2: Assigning Construction Jobs to Subcontractors
Suppose that the data from Example 2.1 are transposed so that the variables are jobs.
Then each observation contains the profit from awarding each job to a single
subcontractor. The following program finds the maximum profit assignment and produces
Output 2.2.1.
data profit;
input subcont $ job1-job9;
datalines;
SUBCON1 79 43 29 88 65 44 35 50 25
SUBCON2 24 59 52 83 90 79 51 12 17
SUBCON3 13 33 0 64 56 86 -9 59 39
SUBCON4 53 95 27 72 62 93 91 32 .
SUBCON5 47 55 13 0 53 71 39 23 38
SUBCON6 66 97 33 67 91 7 32 64 63
SUBCON7 85 34 0 27 48 86 32 0 87
SUBCON8 17 55 11 47 23 59 12 94 14
SUBCON9 92 84 71 83 6 0 79 97 4
SUBCON10 47 94 86 62 89 56 25 14 18
SUBCON11 46 26 6 35 49 45 79 11 11
SUBCON12 13 56 76 38 33 59 81 97 45
;
proc print;
sum _fcost_;
run;
This means that the contractor can expect a profit of $814 if the optimal assignment is
Followed.
77
Output 2.2.1: Assigning Construction Jobs to Subcontractors
This information can be useful when you use PROC ASSIGN as part of a larger SAS
program. For example, information can be written to the SAS log with the statement
%put &_orassig;
STATUS=SUCCESSFUL OBJECTIVE=814.
78
3. THENETWORK PROCEDURE
The following example is taken from the user's guide of the GINO program (Liebman,
Lasdon, Schrage, and Waren 1986). A simple network of five roads (arcs) can be
illustrated by a path diagram.
The five roads connect four intersections illustrated by numbered nodes. Each minute, F
vehicles enter and leave the network. The parameter xij refers to the flow from node i to
node j. The requirement that traffic that flows into each intersection j must also flow out
is described by the linear equality constraint
In general, roads also have an upper limit on the number of vehicles that can be handled
per minute. These limits, denoted cij, can be enforced by boundary constraints:
The goal in this problem is to maximize the flow, which is equivalent to maximizing the
objective function f(x), where f(x) is
The three linear equality constraints are linearly dependent. One of them is deleted
automatically by the optimization subroutine. The following notation is used in this
example:
79
X1=x12, X2=x13, X3=x32, X4=x24, X5=x34
Even though the NLPCG subroutine is used, any other optimization subroutine would
also solve this small problem.
proc iml;
title 'Maximum Flow Through a Network';
start MAXFLOW(x);
f = x[4] + x[5];
return(f);
finish MAXFLOW;
con = { 0. 0. 0. 0. 0. . . ,
10. 30. 10. 30. 10. . . ,
0. 1. -1. 0. -1. 0. 0. ,
1. 0. 1. -1. 0. 0. 0. ,
1. 1. 0. -1. -1. 0. 0. };
x = j(1,5, 1.);
optn = {1 3};
call nlpcg(xres,rc,"MAXFLOW",x,optn,con);
Finding the maximum flow through a network is equivalent to solving a simple linear
optimization problem, and for large problems, the LP procedure or the NETFLOW
procedure of the SAS/OR product can be used. On the other hand, finding a traffic pattern
that minimizes the total delay to move F vehicles per minute from node 1 to node 4
includes nonlinearities that need nonlinear optimization techniques. As traffic volume
increases, speed decreases. Let tij be the travel time on arc (i,j) and assume that the
following formulas describe the travel time as decreasing functions of the amount of
traffic:
80
These formulas use the road capacities (upper bounds), and you can assume that F=5
vehicles per minute have to be moved through the network. The objective is now to
minimize
f =f(x)= t12 x12 + t13 x13 + t32 x32 + t24 x24 + t34 x34
The constraints are
In the following code, the NLPNRR subroutine is used to solve the minimization
problem:
proc iml;
title 'Minimize Total Delay in Network';
start MINDEL(x);
t12 = 5. + .1 * x[1] / (1. - x[1] / 10.);
t13 = x[2] / (1. - x[2] / 30.);
t32 = 1. + x[3] / (1. - x[3] / 10.);
t24 = x[4] / (1. - x[4] / 30.);
t34 = 5. + .1 * x[5] / (1. - x[5] / 10.);
f = t12*x[1] + t13*x[2] + t32*x[3] + t24*x[4] + t34*x[5];
return(f);
finish MINDEL;
con = { 0. 0. 0. 0. 0. . . ,
10. 30. 10. 30. 10. . . ,
0. 1. -1. 0. -1. 0. 0. ,
1. 0. 1. -1. 0. 0. 0. ,
0. 0. 0. 1. 1. 0. 5. };
x = j(1,5, 1.);
optn = {0 3};
call nlpnrr(xres,rc,"MINDEL",x,optn,con);
81
The optimal solution is shown in the following output.
The active constraints and corresponding Lagrange multiplier estimates (costs) are shown
in the following output.
82
B. Example 6.9: Minimize Total Delay in a Network
The following example is taken from the user's guide of GINO (Liebman et al. 1986). A
simple network of five roads (arcs) can be illustrated by the path diagram:
The five roads connect four intersections illustrated by numbered nodes. Each minute
vehicles enter and leave the network. Arc (i,j) refers to the road from intersection i to
intersection j, and the parameter xij refers to the flow from i to j. The law that traffic
flowing into each intersection must also flow out is described by the linear equality
constraint
In general, roads also have an upper capacity, which is the number of vehicles which can
be handled per minute. The upper limits cij can be enforced by boundary constraints
Finding the maximum flow through a network is equivalent to solving a simple linear
optimization problem, and for large problems, PROC LP or PROC NETFLOW can be
used. The objective function is
83
and the constraints are
The three linear equality constraints are linearly dependent. One of them is deleted
automatically by the PROC NLP subroutines. Even though the default technique is used
for this small example, any optimization subroutine can be used.
proc nlp all initial=.5;
max y;
parms x12 x13 x32 x24 x34;
bounds x12 <= 10,
x13 <= 30,
x32 <= 10,
x24 <= 30,
x34 <= 10;
/* what flows into an intersection must flow out */
lincon x13 = x32 + x34,
x12 + x32 = x24,
x24 + x34 = x12 + x13;
y = x24 + x34 + 0*x12 + 0*x13 + 0*x32;
run;
The iteration history is given in Output 6.9.1, and the optimal solution is given in Output
6.9.2.
84
Output 6.9.2: Optimization Results
Finding a traffic pattern that minimizes the total delay to move F vehicles per minute
from node 1 to node 4 introduces nonlinearities that, in turn, demand nonlinear
optimization techniques. As traffic volume increases, speed decreases. Let tij be the travel
time on arc (i,j) and assume that the following formulas describe the travel time as
decreasing functions of the amount of traffic:
These formulas use the road capacities (upper bounds), assuming F = 5 vehicles per
minute have to be moved through the network. The objective function is now
85
Again, the default algorithm is used:
The iteration history is given in Output 6.9.3, and the optimal solution is given in Output
6.9.4.
86
Output 6.9.4: Opimization Results
The active constraints and corresponding Lagrange multiplier estimates (costs) are given
in Output 6.9.5 and Output 6.9.6, respectively.
87
Output 6.9.7 shows that the projected gradient is very small, satisfying the first-order
optimality criterion.
The projected Hessian matrix (shown in Output 6.9.8) is positive definite, satisfying the
second-order optimality criterion.
This example shows the use of LAG variables to describe nonstandard relationships.
Consider the project network in AON format. Output 2.11.1 shows the data set
WIDGLAG, which contains the required project information; here the data set contains
only one successor variable, requiring multiple observations for activities that have more
than one immediate successor. In addition, the data set contains two new variables, lagdur
and lagdurc, which are used to convey nonstandard relationships that exist between some
of the activities. In the first part of the example, lagdur specifies a lag type and lag
duration between activities; in the second part, the variable lagdurc specifies a lag
calendar in addition to the lag type and lag duration. Note that when multiple successor
88
variables are used, you can specify multiple lag variables and the lag values specified are
matched one-for-one with the corresponding successor variables.
Non-Standard Relationships
Activity Data Set WIDGLAG
4 Drawings 10 Prototype
16 Evaluate 10 Changes
18 Changes 5 Production
19 Production 0
20 Marketing 0
Suppose that the project calendar follows a five-day work week. Recall from Example 2.6
that the project finishes on March 8, 2004. The data set, WIDGLAG, specifies that there
is a 'ss_9' lag between the activities 'Prototype' and 'Materials', which means that you can
89
start acquiring raw materials nine days after the start of the activity 'Prototype' instead of
waiting until its finish time. Likewise, there is an 'ss_9' lag between 'Prototype' and
'Facility'. The 'fs_2' lag between 'Facility' and 'Init. Prod' indicates that you should wait
two days after the completion of the 'Facility' task before starting the initial production.
To convey the lag information to PROC CPM, use the LAG= specification in the
SUCCESSOR statement. The program and the resulting output (Output 2.11.2) follow.
Non-Standard Relationships
Lag Type and Duration: Default LAG Calendar
90
Note that due to the change in the type of precedence constraint (from the default 'fs_0' to
'ss_9'), the project finishes earlier, on March 2, 2004, instead of on March 8, 2004
(compare with Output 2.6.1).
By default, all the lags are assumed to follow the default calendar for the project. In this
case, the default project calendar has five workdays (since INTERVAL=WEEKDAY).
Suppose now that the 'fs_2' lag between 'Facility' and 'Init. Prod.' really indicates two
calendar days and not two workdays. (Perhaps you want to allow two days for the paint to
dry or the building to be ventilated.) The variable lagdurc in the WIDGLAG data set
indicates the calendar for this lag by specifying the lag to be 'fs_2_sevenday' where
'sevenday' is the name of the seven-day calendar defined in the Calendar data set,
CALENDAR, displayed in Output 2.11.3. PROC CPM is invoked with LAG=lagdurc and
Output 2.11.4 displays the resulting schedule. Note that the project now finishes on
March 1, 2004.
Non-Standard Relationships
Calendar Data Set
91
Output 2.11.4: Project Schedule: Lag Type, Duration, and Calendar
Non-Standard Relationships
Lag Type, Duration, and Calendar
In fact, you can specify an alternate calendar for all the lag durations by using the
ALAGCAL= or NLAGCAL= option in the SUCCESSOR statement. The next invocation
of the CPM procedure illustrates this feature by specifying ALAGCAL=SEVENDAY in
the SUCCESSOR statement. Thus, all the lag durations now follow the seven-day
calendar instead of the five-day calendar, which is the default calendar for this project.
Output 2.11.5 shows the resulting schedule. Note that now the project finishes on
February 27, 2004. Output 2.11.6 displays a precedence Gantt chart of the project. Note
how the nonstandard precedence constraints are displayed.
proc cpm data=widglag date='1dec03'd calendar=calendar
interval=weekday collapse out=lagsched;
activity task;
succ succ / lag = (lagdur) alagcal=sevenday;
duration days;
run;
goptions hpos=100 vpos=60;
title c=black f=swiss h=2.5 'Non-Standard Relationships';
92
title2 c=black f=swiss h=2 'Precedence Gantt Chart';
title3 ' ';
Non-Standard Relationships
Lag Type and Duration: LAG Calendar = SEVENDAY
93
B. Example 2.10: Multiple Calendars
This example illustrates the use of multiple calendars within a project. Different scenarios
are presented to show the use of different calendars and how project schedules are
affected. Output 2.10.1 shows the data set WORKDATA, which defines several shift
patterns. These shift patterns are appropriately associated with three different calendars in
the data set CALEDATA, also shown in the same output. The three calendars are defined
as follows:
The DEFAULT calendar has five eight-hour days (Monday through Friday) and
holidays on Saturday and Sunday.
The calendar OVT_CAL specifies an overtime calendar that has 10-hour work
days on Monday through Friday and a half day on Saturday and a holiday on
Sunday.
94
break from 6 p.m. to 8 p.m.; on Tuesday through Friday work is done round the
clock with two 2-hour breaks from 6 a.m. to 8 a.m. and 6 p.m. to 8 p.m.; on
Saturday the work shifts are from midnight to 6 a.m. and again from 8 a.m. to 6
p.m. In other words, work is done continuously from 8 a.m. on Monday morning
to 6 p.m. on Saturday with two hour breaks every day at 6 a.m. and 6 p.m.
Multiple Calendars
Workdays Data Set
4 . . . 18:00 . 18:00
5 . . . 20:00 . .
6 . . . . . .
Multiple Calendars
CALENDAR Data Set
3 PROD_CAL holiday s2 s1 s1 s1 s1 s3
The same set of holidays is used as in Example 2.9, except that in this case the holiday
for New Year's is defined by specifying both the start and finish time for the holiday
95
instead of defaulting to a one-day long holiday. When multiple calendars are involved, it
is often less confusing to define holidays by specifying both a start and a finish time for
the holiday instead of the start time and duration. Output 2.10.2 displays the Holiday data
set.
Multiple Calendars
Holidays Data Set
1 24DEC03 26DEC03 4
2 01JAN04 01JAN04 .
Note that the data set HOLIDAYS does not include any variable identifying the calendars
with which to associate the holidays. By default, the procedure associates the two holiday
periods with all the calendars.
An easy way to visualize all the breaks and holidays for each calendar is to use a Gantt
chart, plotting a bar for each calendar from the start of the project to January 4, 2004,
with all the holiday and work shift specifications. The following program produces
Output 2.10.3. Note that holidays and breaks are marked with a solid fill pattern.
Output 2.10.3: Gantt Chart Showing Breaks and Holidays for Multiple Calendars
96
The Activity data set used in Example 2.9 is modified by adding a variable called cal,
which sets the calendar to be 'PROD_CAL' for the activity 'Production', and 'OVT_CAL'
for the activity 'Prototype', and the DEFAULT calendar for the other activities. Thus, in
97
both the Activity data set and the Calendar data set, the calendar information is conveyed
through a CALID variable, cal.
PROC CPM is first invoked without reference to the CALID variable. Thus, the
procedure recognizes only the first observation in the Calendar data set (a warning is
printed to the log to this effect), and only the default calendar is used for all activities in
the project. The daylength parameter is interpreted as the length of a standard work day;
all the durations are assumed to be in units of this standard work day. Output 2.10.4
displays the schedule obtained. Note that the project is scheduled to finish on March 12,
2004, at 12 noon.
data widgcal;
set widget9;
if task = 'Production' then cal = 'PROD_CAL';
else if task = 'Prototype' then cal = 'OVT_CAL';
else cal = 'DEFAULT';
run;
98
Next PROC CPM is invoked with the CALID statement identifying the variable CAL in
the Activity and Calendar data sets. Recall that the two activities, 'Production' and
'Prototype', do not follow the default calendar. The schedule displayed in Output 2.10.5
shows that, due to longer working hours for these two activities in the project, the
scheduled finish date is now March 8, at 10:00 a.m.
99
Now suppose that the engineer in charge of writing specifications requests a seven-day
vacation from December 8, 2003. How is the project completion time going to be
affected? A new calendar, Eng_cal, is defined that has the same work pattern as the
default calendar, but it also contains an extra vacation period. Output 2.10.6 displays the
data sets HOLIDATA and CALEDATA, which contain information about the new
calendar. The fourth observation in the data set CALEDATA has missing values for the
variables _sun_, ..., _sat_, indicating that the calendar, Eng_cal, follows the same work
pattern as the default calendar.
100
Once again, in the following code, PROC GANTT is used to compare the new calendar
with the default calendar, as shown in Output 2.10.7. Note that the breaks and holidays
are marked with a solid fill pattern.
title2 'Breaks and Holidays for Eng_cal and the DEFAULT Calendar';
proc gantt data=cals2 graphics
calendar=caledata holidata=holidata
workday=workdata;
chart / interval=dtday mininterval=dthour skip=2
holiday=(holiday) holifin=(holifin) holidur=(holidur)
markbreak daylength='08:00't calid=cal
ref='1dec03:00:00'dt to '18dec03:00:00'dt by dtday
nojobnum nolegend increment=16 hpages=3;
id cal;
run;
Output 2.10.7: Difference between Eng_cal and DEFAULT Calendar
101
The Activity data set is modified to redefine the calendar for the task 'Write Specs'.
PROC CPM is invoked, and Output 2.10.8 shows the new schedule obtained. Note the
effect of the Engineer's vacation on the project completion time. The project is now
scheduled to finish at 10 a.m. on March 9, 2004; in effect, the delay is only one day, even
though the planned vacation period is seven days. This is due to the fact that the activity
'Write Specs', which follows the new calendar, had some slack time present in its original
schedule; however, this activity has now become critical.
data widgvac;
set widgcal;
if task = 'Write Specs' then cal = 'Eng_cal';
run;
102
title2 'Project Schedule: Four Calendars';
proc print;
var task days cal e_: l_: t_float f_float;
run;
The cost to freight a pineapple is known for each arc. You can use PROC NETFLOW to
determine what routes should be used to minimize total shipping cost. The shortest path is
103
the least cost path that all pineapples should use. The SHORTPATH option indicates this
type of network problem.
The SINK= option value HEATHROW LONDON is not a valid SAS variable name so it
must be enclosed in single quotes. The TAILNODE list variable is FFROM. Because the
name of this variable is not _TAIL_ or _FROM_, the TAILNODE list must be specified
in the PROC NETFLOW statement. The HEADNODE list must also be explicitly
specified because the variable that belongs to this list does not have the name _HEAD_ or
_TO_, but is TTO.
104
New York Heathrow London 65
Atlanta Heathrow London 76
;
proc netflow
shortpath
sourcenode=Honolulu
sinknode='Heathrow London' /* Quotes for embedded blank */
ARCDATA=aircost1
arcout=spath;
tail ffrom;
head tto;
run;
The output data set ARCOUT=SPATH in Output 5.1.1 shows that the best route for the
pineapples is from Honolulu to Los Angeles to New York to Heathrow London.
105
B. Example 5.2: Minimum Cost Flow Problem
You can continue to use the pineapple example in Example 5.1 by supposing that the
airlines now stipulate that no more than 350 pineapples per week can be handled in any
single leg of the journey. The restaurant uses 500 pineapples each week. How many
pineapples should take each route between Hawaii and London?
You will probably have more minimum cost flow problems because they are more
general than maximal flow and shortest path problems. A shortest path formulation is no
longer valid because the sink node does not demand one flow unit.
All arcs have the same capacity of 350 pineapples. Because of this, the DEFCAPACITY=
option can be specified in the PROC NETFLOW statement, rather than having a
CAPACITY list variable in ARCDATA=aircost1. You can have a CAPACITY list
variable, but the value of this variable would be 350 in all observations, so using the
DEFCAPACITY= option is more convenient. You would have to use the CAPACITY list
variable if arcs had differing capacities. You can use both the DEFCAPACITY= option
and a CAPACITY list variable.
106
There is only one supply node and one demand node. These can be named in the
SOURCE= and SINK= options. DEMAND=500 is specified for the restaurant demand.
There is no need to specify SUPPLY=500, as this is assumed.
107
Figure 5.27: Pineapple Routes: Minimum Cost Flow Solution
The routes and numbers of pineapples in each arc can be seen in the output data set
ARCOUT=arcout1 in Output 5.2.1. NODEOUT=NODEOUT1 is shown in Output 5.2.2.
108
6. TIMEPLOT PROCEDURE
LOG
NOTE: AUTOEXEC processing completed.
1 data cotton;
2 input year US world @@;
3 label US='US COTTON PRODUCTION'
109
4 WORLD='WORLD COTTON PRODUCTION';
5 cards;
NOTE: SAS went to a new line when INPUT statement reached past the
end of a line.
NOTE: The data set WORK.COTTON has 16 observations and 3 variables.
NOTE: DATA statement used (Total process time):
real time 0.10 seconds
cpu time 0.11 seconds
14 ;
15 proc sort;
16 by year;
NOTE: There were 16 observations read from the data set WORK.COTTON.
NOTE: The data set WORK.COTTON has 16 observations and 3 variables.
NOTE: PROCEDURE SORT used (Total process time):
real time 0.04 seconds
cpu time 0.04 seconds
17 proc timeplot;
18 plot US WORLD / OVERLAY REF=MEAN (US WORLD) HILOC POS=64;
19 id YEAR;
20 Title'Trends in Cotton Production';
21 title2'Selected Year1940-1982';
22 title4'(Millions of Bales)';
23 run;
RESULT
110
B. Example 1: Plotting a Single Variable (FROM SAS HELP)
Procedure features:
ID statement
PLOT statement arguments:
POS=
This example
provides context for the points in the plot by printing in the listing the values of
two variables that are not in the plot.
Program
options nodate pageno=1 linesize=80 pagesize=60;
data sales;
input Month Week Seller $ Icebox Stove;
datalines;
111
1 1 Kreitz 3450.94 1312.61
1 1 LeGrange 2520.04 728.13
1 2 Kreitz 3240.67 222.35
1 2 LeGrange 2675.42 184.24
1 3 Kreitz 3160.45 2263.33
1 3 LeGrange 2805.35 267.35
1 4 Kreitz 3400.24 1787.45
1 4 LeGrange 2870.61 274.51
2 1 Kreitz 3550.43 2910.37
2 1 LeGrange 2730.09 397.98
2 2 Kreitz 3385.74 819.69
2 2 LeGrange 2670.93 2242.24
;
id month week;
LOG
NOTE: AUTOEXEC processing completed.
1
2 options nodate pageno=1 linesize=80 pagesize=60;
3
4 data sales;
5 input Month Week Seller $ Icebox Stove;
6 datalines;
19 ;
20
21 proc timeplot data=sales;
22 plot icebox / pos=50;
23
24 id month week;
25
26 title 'Weekly Sales of Iceboxes';
27 title2 'for the';
28 title3 'First Six Weeks of the Year';
29 run;
112
NOTE: PROCEDURE TIMEPLOT used (Total process time):
real time 0.03 seconds
cpu time 0.03 seconds
RESULT
CONCLUSION
113
After the above explanation can note that the SAS portable computing devices is the most
fast and precise so that the program counts data processed produce output that is accurate
and reliable. Later, a student with a characteristic relationship test values can be found by
looking at the output.
In the company's aircraft, we need to know how many request tickets Sriwijaya Air. That
is because the aims for the program manager would do in order to serve the public better.
SAS can also be used in the sales of dairy products Dancow baby. Knowing the baby's
milk demand according to the income every person and based on the price of other dairy
products.
SAS in Management science is also important. To analyze the phenomena that occur in
the world of management.
Price competition between shops right now it's been a lot going on. Between Alfamart
and Indomaret, a regular stall. SAS is used to measure the price competition is very
useful. But, price and Alfamart Indomaret tends to be higher than the usual Stalls.
REFERENCES
114
- SAS Basic
- Modul SAS: Basics, Management Science/Operation Research, Econometrics
and Time Series
- Nuri Resti Chayyanis Paper
115