Sie sind auf Seite 1von 115

THE COLLECTIVE ASSIGNMENTS CONSISTS OF TOPICS

AS SHOWN ON THE NEXT PAGES

Submitted by:

Name : Indri Yani Ismatul Hasanah

NPM : 1411021055

To :

Hi. Johannis Damiri, SE., M.Sc., Ph.D

As Partial Fulfilment of EBE612234: International Economics

Department of Economic Development

Faculty of Economics and Bussines

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.

Bandar Lampung, 11 June 2016

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

o How to put together the outline of Protable SAS?


o What is the relationship of student characteristics to the value of the test?
o How to be a manager of a company airplane?
o How to be a sales manager?
o Why should devise Management Science?
o How price competition between different Retail stores?
o What do we do in the Loan Procedure?
o How do I use the evaluation of the project?
o How to calculate the income inequality and child kost given pocket money
from their parents?

3. Purpose

o Knowing the drafting formulation of the Protable SAS.


o relationship characteristics of students with the value of the test.
o Can be a manager of a company airplane.
o Can be assigned to a sales manager.
o Understand about the Management Science.
o Explaining the price competition between different Retail stores.
o Knowing the mechanism in the Loan Procedure.
o Find out how to calculate the GE, Atkinson, and Gini Ratio.

5
TOPIC

1. The Influence Of Characteristic Of Students On Exam Marks

EXAM MARK AGE PAPER MARK SEX YEAR IN COLLEGE IQ

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

Based on the table above, would like to:


a. Create a pie chart for year in college
b. Create a histogram for IQ
c. Make a scatter plot with IQ on the x-axis and exam grade on the y-axis
d. Make a scatter plot with sex on the x-axis and IQ on the y-axis
e. Compute the mean IQ for female and male
f. Create a new dummy variable

A. Create a pie chart for year in college

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).

B. Create a histogram for IQ

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

The SAS System


11:31 Thursday, June 18, 2016 1
Plot of IQ*sex. Legend: A = 1 obs, B = 2 obs, etc.
IQ

180




A

160






140 A



A
A

120 B A

A A




100 C A
A


A A
A
A
80 B
A

12

B



60 A


0 1

Sex

The SAS System


12:45 Friday, June 7, 2016 2
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

E. Compute the mean IQ for female and male

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

Means of IQ for Male and Female 1

The MEANS Procedure

Analysis Variable : IQ
N

sex Obs N Mean Std Dev Minimum Maximum

0 13 13 101.000 22.793 60.000 140.000

1 11 11 101.182 28.698 70.000 165.000

F. Create a new dummy variable

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

12:09 Thursday, June 18, 2016 1

exam_ paper_ year_in_


Obs mark age mark sex college IQ mutu

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

G. Record the sex variable, 0=female and 1=male

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

exam_ paper_ year_in_


Obs mark age mark sex college IQ mutu

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

The SAS System


20:40 Thursday, June 11, 2016 1

The REG Procedure


Model: MODEL1
Dependent Variable: Exam_Mark

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

Model 5 757.59894 151.51979 3.80 0.0160


Error 18 718.40106 39.91117
Corrected Total 23 1476.00000
Root MSE 6.31753 R-Square 0.5133
Dependent Mean 82.00000 Adj R-Sq 0.3781
Coeff Var 7.70430

Parameter Estimates

Parameter Standard Variance


Variable DF Estimate Error t Value Pr > |t| Inflation

Intercept 1 46.75101 11.78821 3.97 0.0009 0


Age 1 0.16401 0.33015 0.50 0.6254 1.30805
paper_mark 1 0.21789 0.21786 1.00 0.3305 2.88889
sex 1 4.84565 2.75318 1.76 0.0954 1.13161
year_in_collage 1 0.20819 1.48461 0.14 0.8900 1.32539
IQ 1 0.11118 0.08802 1.26 0.2227 2.80886

I. Regresi Komponen Utama

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;

PROC reg DATA=KU;

Model Y=prin1 prin2 prin3 prin4 prin5/dw vif;

output out=KU_hasil r=error;

run;

RESULT
KOMPONEN UTAMA
20:41 Thursday, June 11, 2016 1

The PRINCOMP Procedure

Observations 24
Variables 5

Simple Statistics

X1 X2 X3 X4 X5

Mean 22.95833333 80.33333333 0.4583333333 2.500000000 101.0833333

StD 4.56336229 10.27731426 0.5089773777 1.021507837 25.0823282

Correlation Matrix

X1 X2 X3 X4 X5

X1 1.0000 0.2970 -.0850 0.3311 0.1820


X2 0.2970 1.0000 0.1773 0.1367 0.7493
X3 -.0850 0.1773 1.0000 0.0418 0.0037
X4 0.3311 0.1367 0.0418 1.0000 0.3139
X5 0.1820 0.7493 0.0037 0.3139 1.0000

Eigenvalues of the Correlation Matrix

Eigenvalue Difference Proportion Cumulative

1 2.05773029 0.93469316 0.4115 0.4115


2 1.12303713 0.18692351 0.2246 0.6362
3 0.93611362 0.23160707 0.1872 0.8234
4 0.70450655 0.52589414 0.1409 0.9643

19
5 0.17861240 0.0357 1.0000

Eigenvectors

Prin1 Prin2 Prin3 Prin4 Prin5

X1 0.379788 -.515249 0.228583 0.703185 0.208710


X2 0.592348 0.311439 -.259926 0.191415 -.669275
X3 0.085718 0.678079 0.686654 0.175435 0.174901
X4 0.375949 -.387697 0.547097 -.596485 -.230746
X5 0.596824 0.165603 -.330727 -.286912 0.651673

KOMPONEN UTAMA
20:41 Thursday, June 11, 2016 2

The REG Procedure


Model: MODEL1
Dependent Variable: Y

Number of Observations Read 24


Number of Observations Used 24

Analysis of Variance

Sum of Mean
Source DF Squares Square F Value Pr > F

Model 5 757.59894 151.51979 3.80 0.0160


Error 18 718.40106 39.91117
Corrected Total 23 1476.00000

Root MSE 6.31753 R-Square 0.5133


Dependent Mean 82.00000 Adj R-Sq 0.3781
Coeff Var 7.70430
Parameter Estimates

Parameter Standard Variance


Variable DF Estimate Error t Value Pr > |t| Inflation

Intercept 1 82.00000 1.28956 63.59 <.0001 0


Prin1 1 3.56638 0.91831 3.88 0.0011 1.00000
Prin2 1 2.36349 1.24304 1.90 0.0734 1.00000
Prin3 1 0.47662 1.36150 0.35 0.7303 1.00000
Prin4 1 0.46070 1.56943 0.29 0.7725 1.00000
Prin5 1 0.85700 3.11693 0.27 0.7865 1.00000

KOMPONEN UTAMA
20:41 Thursday, June 11, 2016 3

The REG Procedure


Model: MODEL1
Dependent Variable: Y

Durbin-Watson D 2.454
Number of Observations 24
1st Order Autocorrelation -0.257

2. The Demand Forecast of Airplanes of Sriwijaya based on Market Share

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

The Forecast of Indonesian Passanger Flights From Proc Forecast SteparMethod


1
19:45 Thursday, June 13, 2016

Obs _TYPE_ _LEAD_ YEAR PASS

1 ACTUAL 0 2006 35562000.00


2 FORECAST 0 2006 31882571.43
3 ACTUAL 0 2007 38359000.00
4 FORECAST 0 2007 37296714.29
5 ACTUAL 0 2008 41446000.00
6 FORECAST 0 2008 42710857.14
7 ACTUAL 0 2009 43442000.00
8 FORECAST 0 2009 48125000.00
9 ACTUAL 0 2010 49707000.00
10 FORECAST 0 2010 53539142.86
11 ACTUAL 0 2011 58338000.00
12 FORECAST 0 2011 58953285.71
13 ACTUAL 0 2012 70021000.00
14 FORECAST 0 2012 64367428.57
15 FORECAST 1 2013 69781571.43
16 L95 1 2013 59186959.68
17 U95 1 2013 80376183.18
18 FORECAST 2 2014 75195714.29
19 L95 2 2014 63650503.80
20 U95 2 2014 86740924.77
21 FORECAST 3 2015 80609857.14
22 L95 3 2015 67999746.89
23 U95 3 2015 93219967.40
24 FORECAST 4 2016 86024000.00
25 L95 4 2016 72261195.62
26 U95 4 2016 99786804.38
27 FORECAST 5 2017 91438142.86
28 L95 5 2017 76455099.24
29 U95 5 2017 106421186.48

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

MENCARI PERSENTASE: Forecast-Actual /Forecast*100

SIMPANGAN : Jumlah %/n

2006 = 31882571.43 - 35562000.00/31882571.43*100

= -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

B. Exponential Smoothings Method

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

The Output Forecast from PROC FORECAST The Expo method


1
19:57 Thursday, June 13, 2016

Obs _TYPE_ _LEAD_ YEAR PASS

1 ACTUAL 0 2006 35562000.00


2 FORECAST 0 2006 31882571.43
3 ACTUAL 0 2007 38359000.00
4 FORECAST 0 2007 38032600.00
5 ACTUAL 0 2008 41446000.00
6 FORECAST 0 2008 43548817.14
7 ACTUAL 0 2009 43442000.00
8 FORECAST 0 2009 48582454.86
9 ACTUAL 0 2010 49707000.00
10 FORECAST 0 2010 52987536.86
11 ACTUAL 0 2011 58338000.00
12 FORECAST 0 2011 57713197.91
13 ACTUAL 0 2012 70021000.00
14 FORECAST 0 2012 63187121.38
15 FORECAST 1 2013 69909108.18
16 L95 1 2013 60150486.26
17 U95 1 2013 79667730.10
18 FORECAST 2 2014 75332658.04
19 L95 2 2014 65480479.52
20 U95 2 2014 85184836.57
21 FORECAST 3 2015 80756207.90
22 L95 3 2015 70802571.54
23 U95 3 2015 90709844.27
24 FORECAST 4 2016 86179757.76
25 L95 4 2016 76117001.32
26 U95 4 2016 96242514.21
27 FORECAST 5 2017 91603307.63
28 L95 5 2017 81424015.27
29 U95 5 2017 101782599.98

Tahun Forecast Actual persentase Simpangan


2006 31882571.43 35562000.00 -11,5405 -0,3851
2007 38032600.00 38359000.00 -0,8582
2008 43548817.14 41446000.00 4,8286
2009 48582454.86 43442000.00 10,5808
2010 52987536.86 49707000.00 6,1911
2011 57713197.91 58338000.00 -1,0825
2012 63187121.38 70021000.00 -10,8153
2013 - -
2014 75332658.04 -
2015 - -
2016 86179757.76 -
2017 91603307.63 -

SUM -2,696

MENCARI PERSENTASE: Forecast-Actual /Forecast*100

SIMPANGAN : Jumlah %/n

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

The Output Forecast of Indonesian Passanger Flights From PROC FORECAST:


WINTERS Method 1
20:25 Thursday, June 13, 2016

Obs _TYPE_ _LEAD_ YEAR PASS

1 ACTUAL 0 2006 35562000.00


2 FORECAST 0 2006 31882571.43
3 ACTUAL 0 2007 38359000.00
4 FORECAST 0 2007 37726171.40
5 ACTUAL 0 2008 41446000.00

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

Tahun Forecast Actual persentase Simpangan


2006 31882571.43 35562000.00 -11,5405 -0,2536
2007 37726171.40 38359000.00 -1,6774
2008 43255186.52 41446000.00 4,1825
2009 48506226.75 43442000.00 10,4403
2010 53357179.29 49707000.00 6,8410
2011 58316733.30 58338000.00 -0,0364
2012 63664129.20 70021000.00 -9,9850
2013 69751243.88 -
2014 75167245.84 -
2015 80583247.81 -
2016 85999249.78 -
2017 91415251.75 -

SUM -1,7755

MENCARI PERSENTASE: Forecast-Actual /Forecast*100

SIMPANGAN : Jumlah %/n

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

D. The Add-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=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

Obs _TYPE_ _LEAD_ YEAR PASS

1 ACTUAL 0 2006 35562000.00


2 FORECAST 0 2006 31882571.43
3 ACTUAL 0 2007 38359000.00
4 FORECAST 0 2007 37726171.40
5 ACTUAL 0 2008 41446000.00
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

26
28 L95 5 2017 82496587.18
29 U95 5 2017 100333916.33

Tahun Forecast Actual persentase Simpangan


2006 31882571.43 35562000.00 -11,5405 -0,2536
2007 37726171.40 38359000.00 -1,6774
2008 43255186.52 41446000.00 4,1825
2009 48506226.75 43442000.00 10,4403
2010 53357179.29 49707000.00 6,8410
2011 58316733.30 58338000.00 -0,0364
2012 63664129.20 70021000.00 -9,9850
2013 69751243.88 -
2014 75167245.84 -
2015 80583247.81 -
2016 85999249.78 -
2017 91415251.75 -

SUM -1,7755

MENCARI PERSENTASE: Forecast-Actual /Forecast*100

SIMPANGAN : Jumlah %/n

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

4 58000 57000 57000 500000

4 58500 56000 57000 500000

4 58500 57000 50000 500000

4 58500 57000 50000 500000

4 58000 57000 50000 500000

4 57500 57000 50000 500000

4 58000 57000 55000 600000

4 58000 56000 57000 700000

4 58000 56000 50000 700000

4 58000 56000 50000 700000

4 57500 56500 50000 700000

4 58500 56000 57000 700000

4 58000 56500 57000 700000

4 58500 56500 50000 700000

3 58500 56000 55000 700000

4 58500 56000 50000 700000

4 58500 56000 50000 700000

4 58500 57000 55000 700000

4 58500 57000 50000 700000

4 58500 56000 50000 700000

4 58500 57000 50000 750000

4 58000 56000 55000 1000000

4 58000 56000 50000 1000000

4 58500 56000 57000 1000000

4 58500 56000 50000 1000000

4 57500 56500 55000 1000000

4 57500 56000 50000 1000000

4 58500 56000 55000 1000000

3 58500 56000 50000 1000000

4 58000 56500 50000 1000000

4 58500 56500 55000 1000000

4 58500 56500 55000 1000000

4 58500 56000 50000 1000000

34
4 58000 56500 57000 1000000

4 58500 56500 50000 1000000

4 58500 57000 57000 1000000

4 58500 56000 50000 1000000

4 58500 57000 50000 1000000

4 58500 57000 50000 1000000

4 58500 56000 57000 1000000

4 58500 56000 55000 1000000

4 58500 57000 50000 1000000

4 58500 56000 50000 1400000

4 58500 56000 50000 1400000

4 58000 56000 55000 1400000

4 58500 56000 57000 1400000

4 58500 56000 50000 1400000

4 58500 56000 50000 1400000

5 58500 56500 50000 1400000

4 58500 57000 57000 1400000

4 58500 57000 57000 1400000

4 58500 56000 50000 1400000

4 58500 56000 57000 1500000

4 58500 56000 57000 1500000

4 58500 56000 50000 1500000

4 58500 57000 50000 1500000

4 58500 56000 50000 1500000

3 58500 57000 57000 1500000

4 58000 46500 50000 1500000

4 58500 57000 50000 1500000

4 58500 56000 50000 1500000

8 58500 57000 50000 1500000

4 58500 56000 50000 1600000

4 58500 56500 55000 1600000

4 58500 56000 50000 1600000

4 58000 56000 50000 1600000

4 58000 56000 50000 1600000

4 58500 56500 50000 1600000

4 58500 56500 50000 1600000

5 58500 56500 50000 1600000

5 58500 56000 57000 1600000

5 58500 56500 50000 1600000

4 58000 57000 50000 1600000

35
4 58500 57000 50000 1600000

4 58500 57000 57000 1600000

4 58000 56000 50000 1700000

4 57500 56000 50000 1700000

4 58000 56000 57000 1800000

4 58000 56000 50000 1800000

4 58500 56000 50000 1800000

4 57500 57000 50000 1800000

8 58500 57000 50000 1800000

4 58500 57000 50000 2000000

4 58500 46500 50000 2000000

5 58500 56500 55000 2200000

4 58000 56000 50000 2400000

4 57500 56500 50000 2500000

4 58000 56500 50000 2500000

4 58500 56000 50000 2500000

4 58000 57000 55000 2500000

4 58500 57000 50000 2500000

5 58500 56000 50000 2600000

4 57500 56000 50000 2700000

4 57500 56500 50000 2700000

4 57500 56500 50000 2700000

5 57500 56000 57000 2700000

7 58000 56500 55000 2700000

4 58500 56500 57000 2700000

4 58500 56500 55000 2700000

4 58500 56500 55000 2700000

4 58500 56000 55000 2800000

4 58500 56000 57000 3000000

4 58500 56500 57000 3000000

4 57500 56500 50000 3000000

4 58500 56000 50000 3000000

8 58500 56000 50000 3000000

4 58500 56500 50000 3000000

4 58500 56500 57000 3000000

4 58500 56500 50000 3000000

4 57500 56000 50000 3000000

8 58500 56000 50000 3000000

4 58000 56000 55000 3000000

4 58500 56000 57000 3000000

36
4 58500 57000 55000 4000000

4 58500 56000 55000 4500000

8 57500 56500 57000 5000000

4 58500 56000 50000 5000000

4 58500 46500 50000 5000000

5 58000 56000 55000 6000000

4 57500 56500 57000 6000000

4 58000 56500 50000 6000000

5 58500 56000 55000 6000000

4 58500 56500 50000 6000000

10 58500 57000 50000 6000000

5 57500 56500 50000 6000000

6 58500 57000 57000 6000000

4 58500 57000 50000 6000000

proc reg data=milk;


model lny=lnx1 lnx2 lnx3 lnx4;
restrict lnx1+lnx2+lnx3+lnx4=0;
title 'restricted demand function model'
run;
proc reg data=milk;
model y=x1 x2 x3 x4;
title 'unrestricted liner demand function model'
run;
proc reg data=milk;
model lny=lnx1 lnx2 lnx3 lnx4;
title 'unrestricted log demand model'
run;

RESULT

A. RESTRICTED DEMAND FUNCTION


The REG Procedure
Model: MODEL1
Dependent Variable: lny

NOTE: Restrictions have been applied to parameter estimates.

Number of Observations Read 64

37
Number of Observations Used 64

Analysis of Variance

Sum of Mean
Source DF Squares Square F Value Pr > F

Model 3 0.00016525 0.00005508 1.51 0.2214


Error 60 0.00219 0.00003650
Corrected Total 63 0.00236

Root MSE 0.00604 R-Square 0.0702


Dependent Mean 10.97302 Adj R-Sq 0.0237
Coeff Var 0.05506

Parameter Estimates

Parameter Standard
Variable DF Estimate Error t Value Pr > |t|

Intercept 1 10.89473 0.05311 205.12 <.0001


lnx1 1 0.00408 0.01241 0.33 0.7436
lnx2 1 0.00559 0.01193 0.47 0.6412
lnx3 1 -0.00104 0.00122 -0.85 0.3994
lnx4 1 -0.00862 0.00543 -1.59 0.1177
RESTRICT -1 -0.00250 0.00134 -1.86 0.0621*

* Probability computed using beta distribution.

The REG Procedure


Model: MODEL1
Dependent Variable: y jumlah kotak konsumsi susu perbulan

Number of Observations Read 64


Number of Observations Used 64

Analysis of Variance

Sum of Mean
Source DF Squares Square F Value Pr > F

Model 4 1115014 278753 2.41 0.0591


Error 59 6822486 115635
Corrected Total 63 7937500

Root MSE 340.05199 R-Square 0.1405


Dependent Mean 58281 Adj R-Sq 0.0822
Coeff Var 0.58347

B. UNRESTRICTED DEMAND FUNCTION

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;

4 58500 56000 57000 3000000

4 58000 56000 55000 1000000

4 58000 56000 50000 1000000

4 58000 56000 50000 1700000

4 58000 56000 57000 700000

4 58000 56000 50000 700000

4 58000 56000 50000 700000

5 58000 56000 55000 6000000

39
4 57500 56000 50000 2700000

4 58500 56000 50000 1600000

4 58500 56000 50000 1400000

4 58500 56000 57000 1000000

4 58500 56000 50000 1000000

4 58500 56000 50000 1400000

4 58500 56500 55000 1600000

4 58500 56500 57000 3000000

4 57500 56500 50000 2700000

4 57500 56500 50000 2500000

8 57500 56500 57000 5000000

4 57500 56500 50000 2700000

4 57500 56500 55000 1000000

4 57500 56500 50000 700000

4 57500 56500 57000 6000000

4 57500 56500 50000 3000000

5 57500 56000 57000 2700000

4 57500 56000 50000 1000000

4 58500 56000 50000 1600000

4 58500 56000 55000 4500000

4 58000 56000 50000 2400000

4 58500 56000 55000 1000000

3 58500 56000 50000 1000000

4 58500 56000 57000 700000

4 58500 56000 50000 3000000

4 58500 56000 55000 2800000

8 58500 56000 50000 3000000

4 58000 56000 55000 1400000

4 58000 56000 50000 1600000

4 58000 56000 50000 1600000

4 58000 56000 57000 1800000

4 58000 56000 50000 1800000

4 58000 56500 50000 2500000

7 58000 56500 55000 2700000

4 58000 56500 50000 6000000

4 58000 56500 50000 1000000

40
4 58000 56500 57000 700000

4 58500 56500 50000 700000

4 58500 56500 55000 1000000

3 58500 56500 50000 500000

4 58500 56500 50000 3000000

4 58500 56500 57000 2700000

4 58500 56500 50000 1600000

4 58500 56500 50000 1600000

5 58500 56500 55000 2200000

4 58500 56500 55000 2700000

4 58500 56500 57000 3000000

4 58500 56500 50000 3000000

4 58500 56500 55000 1000000

4 58500 56000 57000 1400000

4 58500 56000 50000 1400000

3 58500 56000 55000 700000

4 58500 56000 50000 700000

4 58500 56000 57000 1500000

4 58500 56000 50000 1400000

4 57500 56000 50000 1700000

4 58500 56000 50000 1800000

5 58500 56000 50000 2600000

4 58500 56000 50000 2500000

4 58500 56000 50000 5000000

5 58500 56000 55000 6000000

4 57500 56000 50000 3000000

4 58500 56000 57000 1500000

4 58500 56000 50000 1500000

4 58500 56000 50000 700000

4 58500 56000 50000 1000000

4 58000 56500 57000 1000000

5 58500 56500 50000 1400000

5 58500 56500 50000 1600000

4 58500 56500 50000 6000000

5 58500 56000 57000 1600000

10 58500 57000 50000 6000000

41
4 58500 56500 55000 2700000

5 58500 56500 50000 1600000

5 57500 56500 50000 6000000

6 58500 57000 57000 6000000

4 58500 57000 50000 1500000

4 58500 57000 55000 700000

4 58500 57000 50000 2000000

4 58000 57000 57000 500000

4 58000 57000 50000 1600000

4 58500 56500 50000 1000000

4 58500 57000 57000 1000000

4 58500 56000 50000 1500000

4 58000 57000 55000 600000

4 58500 57000 50000 700000

8 58500 56000 50000 3000000

4 58500 57000 57000 1400000

4 58500 57000 50000 1600000

4 57500 57000 50000 1800000

4 58500 56000 57000 500000

4 58500 57000 50000 500000

4 58500 56000 50000 1000000

4 58500 57000 50000 500000

4 58000 56000 55000 3000000

4 58500 46500 50000 5000000

4 58500 46500 50000 2000000

3 58500 57000 57000 1500000

4 58500 57000 50000 6000000

4 58000 46500 50000 1500000

4 58500 56000 50000 700000

4 58500 56000 57000 3000000

4 58500 57000 50000 1000000

4 58500 57000 50000 1500000

4 58500 57000 55000 4000000

4 58500 57000 50000 750000

4 58000 57000 55000 2500000

8 58500 57000 50000 1800000

42
4 58500 57000 50000 1000000

4 58500 57000 50000 2500000

4 58500 57000 57000 1400000

4 58500 56000 50000 1400000

4 58500 56000 57000 1000000

4 58500 56000 55000 1000000

4 58500 56000 50000 1500000

4 58500 57000 50000 1000000

4 58500 57000 57000 1600000

4 58000 57000 50000 500000

4 57500 57000 50000 500000

8 58500 57000 50000 1500000

;
proc sort data=milk;
by x4;
run;
proc print data=milk;
run;

RESULT

The SAS System


15:25 Thursday, June 12, 2016 1

Obs y x1 x2 x3 x4 class

1 3 58500 56500 50000 500000 low


2 4 58000 57000 57000 500000 low
3 4 58500 56000 57000 500000 low
4 4 58500 57000 50000 500000 low
5 4 58500 57000 50000 500000 low
6 4 58000 57000 50000 500000 low
7 4 57500 57000 50000 500000 low
8 4 58000 57000 55000 600000 low
9 4 58000 56000 57000 700000 low
10 4 58000 56000 50000 700000 low
11 4 58000 56000 50000 700000 low
12 4 57500 56500 50000 700000 low
13 4 58500 56000 57000 700000 low
14 4 58000 56500 57000 700000 low
15 4 58500 56500 50000 700000 low
16 3 58500 56000 55000 700000 low
17 4 58500 56000 50000 700000 low
18 4 58500 56000 50000 700000 low
19 4 58500 57000 55000 700000 low
20 4 58500 57000 50000 700000 low
21 4 58500 56000 50000 700000 low
22 4 58500 57000 50000 750000 low
23 4 58000 56000 55000 1000000 low
24 4 58000 56000 50000 1000000 low
25 4 58500 56000 57000 1000000 low
26 4 58500 56000 50000 1000000 low
27 4 57500 56500 55000 1000000 low
28 4 57500 56000 50000 1000000 low
29 4 58500 56000 55000 1000000 low
30 3 58500 56000 50000 1000000 low
31 4 58000 56500 50000 1000000 low
32 4 58500 56500 55000 1000000 low
33 4 58500 56500 55000 1000000 low
34 4 58500 56000 50000 1000000 low
35 4 58000 56500 57000 1000000 low
36 4 58500 56500 50000 1000000 low

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

The SAS System


15:25 Thursday, June 12, 2016 2

Obs y x1 x2 x3 x4 class

53 4 58500 56000 50000 1400000 low


54 4 58500 56000 57000 1500000 low
55 4 58500 56000 57000 1500000 low
56 4 58500 56000 50000 1500000 low
57 4 58500 57000 50000 1500000 low
58 4 58500 56000 50000 1500000 low
59 3 58500 57000 57000 1500000 low
60 4 58000 46500 50000 1500000 low
61 4 58500 57000 50000 1500000 low
62 4 58500 56000 50000 1500000 low
63 8 58500 57000 50000 1500000 low
64 4 58500 56000 50000 1600000 low
65 4 58500 56500 55000 1600000 low
66 4 58500 56000 50000 1600000 low
67 4 58000 56000 50000 1600000 low
68 4 58000 56000 50000 1600000 low
69 4 58500 56500 50000 1600000 low
70 4 58500 56500 50000 1600000 low
71 5 58500 56500 50000 1600000 low
72 5 58500 56000 57000 1600000 low
73 5 58500 56500 50000 1600000 low
74 4 58000 57000 50000 1600000 low
75 4 58500 57000 50000 1600000 low
76 4 58500 57000 57000 1600000 low
77 4 58000 56000 50000 1700000 low
78 4 57500 56000 50000 1700000 low
79 4 58000 56000 57000 1800000 low
80 4 58000 56000 50000 1800000 low
81 4 58500 56000 50000 1800000 low
82 4 57500 57000 50000 1800000 low
83 8 58500 57000 50000 1800000 low
84 4 58500 57000 50000 2000000 low
85 4 58500 46500 50000 2000000 low
86 5 58500 56500 55000 2200000 med
87 4 58000 56000 50000 2400000 med
88 4 57500 56500 50000 2500000 med
89 4 58000 56500 50000 2500000 med
90 4 58500 56000 50000 2500000 med
91 4 58000 57000 55000 2500000 med
92 4 58500 57000 50000 2500000 med
93 5 58500 56000 50000 2600000 med
94 4 57500 56000 50000 2700000 med
95 4 57500 56500 50000 2700000 med
96 4 57500 56500 50000 2700000 med
97 5 57500 56000 57000 2700000 med
98 7 58000 56500 55000 2700000 med
99 4 58500 56500 57000 2700000 med
100 4 58500 56500 55000 2700000 med
101 4 58500 56500 55000 2700000 med
102 4 58500 56000 55000 2800000 med
103 4 58500 56000 57000 3000000 med
104 4 58500 56500 57000 3000000 med

44
The SAS System
15:25 Thursday, June 12, 2016 3

Obs y x1 x2 x3 x4 class

105 4 57500 56500 50000 3000000 med


106 4 58500 56000 50000 3000000 med
107 8 58500 56000 50000 3000000 med
108 4 58500 56500 50000 3000000 med
109 4 58500 56500 57000 3000000 med
110 4 58500 56500 50000 3000000 med
111 4 57500 56000 50000 3000000 med
112 8 58500 56000 50000 3000000 med
113 4 58000 56000 55000 3000000 med
114 4 58500 56000 57000 3000000 med
115 4 58500 57000 55000 4000000 med
116 4 58500 56000 55000 4500000 hig
117 8 57500 56500 57000 5000000 hig
118 4 58500 56000 50000 5000000 hig
119 4 58500 46500 50000 5000000 hig
120 5 58000 56000 55000 6000000 hig
121 4 57500 56500 57000 6000000 hig
122 4 58000 56500 50000 6000000 hig
123 5 58500 56000 55000 6000000 hig
124 4 58500 56500 50000 6000000 hig
125 10 58500 57000 50000 6000000 hig
126 5 57500 56500 50000 6000000 hig
127 6 58500 57000 57000 6000000 hig
128 4 58500 57000 50000 6000000 hig

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

Objective Function Max _OBS1_


Rhs Variable _RHS_
Type Variable _TYPE_
Problem Density (%) 40.00
Variables Number

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

Objective Value 8000

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

1 X1 BASIC NON-NEG 0.073 20000 0


2 X2 BASIC NON-NEG 0.103 30000 0
3 X3 NON-NEG 0.064 0 -0.011
4 X4 BASIC NON-NEG 0.075 40000 0
5 X5 BASIC NON-NEG 0.045 10000 0
6 _OBS3_ SLACK 0 0 -0.022
7 _OBS4_ BASIC SLACK 0 10000 0
8 _OBS5_ SURPLUS 0 0 -0.024
9 _OBS6_ SLACK 0 0 -0.03

PORTOFOLIO SELECTION
16:30 Thursday, June 11, 2016 4
The LP Procedure

Constraint Summary

Constraint S/S Dual


Row Name Type Col Rhs Activity Activity

1 _OBS1_ OBJECTVE . 0 8000 .


2 _OBS2_ EQ . 100000 100000 0.069
3 _OBS3_ LE 6 50000 50000 0.022
4 _OBS4_ LE 7 50000 40000 0
5 _OBS5_ GE 8 0 0 -0.024
6 _OBS6_ LE 9 0 0 0.03

B. Financial Mix Strategy

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

Objective Value 1191.8604651


Phase 1 Iterations 3
Phase 2 Iterations 1
Phase 3 Iterations 0
Integer Iterations 0
Integer Solutions 0
Initial Basic Feasible Variables 9
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

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

Constraint S/S Dual


Row Name Type Col Rhs Activity Activity

1 _OBS1_ OBJECTVE . 0 1191.8605 .


2 _OBS2_ LE 5 2500 1742.4419 0
3 _OBS3_ LE 6 150 141.39535 0
4 _OBS4_ LE 7 3000 3000 0.2395349
5 _OBS5_ LE 8 10000 4069.7674 0
6 _OBS6_ GE 9 50 50 -2.395349
7 _OBS7_ GE 10 25 45.697674 0
8 _OBS8_ LE 11 3000 3000 0.1976744

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

Objective Value 37000

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

1 X1 BASIC NON-NEG 90 240 0


2 X2 BASIC NON-NEG 70 100 0

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

Constraint S/S Dual


Row Name Type Col Rhs Activity Activity

1 _OBS1_ OBJECTVE . 0 37000 .


2 _OBS2_ LE 4 5000 5000 6
3 _OBS3_ LE 5 1200 1200 12
4 _OBS4_ LE 6 600 440 0
5 _OBS5_ GE 7 100 100 -74

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

Objective Function Max _OBS1_


Rhs Variable _RHS_
Type Variable _TYPE_

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

Constraint S/S Dual


Row Name Type Col Rhs Activity Activity

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

E. Audit Staff Managements

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

AUDIT STAFF ASIGNMENT


18:55 Thursday, June 11, 2016 1
The LP Procedure
Problem Summary

Objective Function Min _OBS1_


Rhs Variable _RHS_
Type Variable _type_
Problem Density (%) 28.57
Variables Number
Non-negative 12
Slack 2
Total 14

Constraints Number

LE 2
EQ 1
Objective 1
Total 4

AUDIT STAFF ASIGNMENT


18:55 Thursday, June 11, 2016 2
The LP Procedure
Solution Summary
Terminated Successfully

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

AUDIT STAFF ASIGNMENT


18:55 Thursday, June 11, 2016 3
The LP Procedure
Variable Summary

Variable Reduced
Col Name Status Type Price Activity Cost

1 X11 NON-NEG 150 0 150


2 X12 DEGEN NON-NEG 210 0 0
3 X13 NON-NEG 270 0 270
4 X21 NON-NEG 170 0 170
5 X22 NON-NEG 230 0 20
6 X23 NON-NEG 220 0 220
7 X31 NON-NEG 180 0 180
8 X32 NON-NEG 230 0 20
9 X33 NON-NEG 225 0 225
10 X41 NON-NEG 160 0 160
11 X42 NON-NEG 240 0 30
12 X43 NON-NEG 230 0 230
13 _OBS3_ DEGEN SLACK 0 0 0
14 _OBS4_ DEGEN SLACK 0 0 0

AUDIT STAFF ASIGNMENT


18:55 Thursday, June 11, 2016 4
The LP Procedure
Constraint Summary

Constraint S/S Dual


Row Name Type Col Rhs Activity Activity

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

5. The Price Competition Between Major Modern, Retail Store, and


Traditional Retail

Nama Barang Alfamart Indomart Warung

Ekonomi putih 500g 3300 3600 4000


Kispray 4x2 7500 7200 9000
Stella all in one 8800 8500 9000
Boom detergent 400g 4950 6000 5000
Sunlight 400ml 8900 8700 9000
Niu green tea 500ml 6400 6300 6500

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

A. SAS PROGRAM ALFAMART AND INDOMART

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

The TTEST Procedure

Statistics

Lower CL Upper CL Lower CL Upper CL


Variable store N Mean Mean Mean Std Dev Std Dev Std Dev Std Err

price i 34 4880.9 8097.6 11314 7435.9 9219.1 12135 1581.1


price w 34 5067.2 8444.1 11821 7806.2 9678.2 12739 1659.8
price Diff (1-2) -4923 -346.5 4230.3 8078.1 9451.4 11392 2292.3

T-Tests

Variable Method Variances DF t Value Pr > |t|

price Pooled Equal 66 -0.15 0.8803


price Satterthwaite Unequal 65.8 -0.15 0.8803
price Cochran Unequal 33 -0.15 0.8808

Equality of Variances

Variable Method Num DF Den DF F Value Pr > F

price Folded F 33 33 1.10 0.7818

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.

B. SAS PROGRAM INDOMART AND STALL

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

The TTEST Procedure

Statistics

Lower CL Upper CL Lower CL Upper CL


Variable store N Mean Mean Mean Std Dev Std Dev Std Dev Std Err

price a 34 4988.2 8237.5 11487 7511.2 9312.4 12258 1597.1


price w 34 5067.2 8444.1 11821 7806.2 9678.2 12739 1659.8
price Diff (1-2) -4805 -206.6 4392.2 8117.1 9497.1 11447 2303.4

T-Tests

Variable Method Variances DF t Value Pr > |t|

price Pooled Equal 66 -0.09 0.9288


price Satterthwaite Unequal 65.9 -0.09 0.9288
price Cochran Unequal 33 -0.09 0.9291

Equality of Variances

Variable Method Num DF Den DF F Value Pr > F

price Folded F 33 33 1.08 0.8262

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.

6. Generalized Entrophy, Athkisan Index, Gini Coeficient.

A. The Generalized Entropy (GE)

n is the number of samples and yi is the income of individual i. GE lies


between 0 to x, where if the value of GE = 0 showing equitable distribution of
income, and if the value of GE = 4 show there is a very big gap. The
parameter measures the magnitude of the differences between distribution
of income in the groups.

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.

The table below is an example of people's income in Tulang Bawang Barat

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

The SAS System


00:09 Friday, June 13, 2016 1

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

A. Fixed 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.

EDITOR
proc loan start=2014:12;

fixed amount=100000000 rate=15 life=144

label='BANK EKA, Fixed Rate';

run;

RESULT

The SAS System


22:00 Thursday, June 12, 2016
1
The LOAN Procedure
Fixed Rate Loan Summary

61
BANK EKA, Fixed Rate

Downpayment 0.00 Principal Amount 100000000.00

Initialization 0.00 Points 0.00

Total Interest 116126253.58 Nominal Rate 15.0000%

Total Payment 216126253.58 Effective Rate 16.0755%

Pay Interval MONTHLY Compounding MONTHLY

No. of Payments 144 No. of Compoundings 144

Start Date DEC2014 End Date DEC2026

Rates and Payments for BANK EKA, Fixed Rate

Date Nominal Rate Effective Rate Payment

DEC2014 15.0000% 16.0755% 1500876.77

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.

B. Ballon Payment 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 with the provisions of the 18th
month payment will rise Rp.1.000.000 and in the 46th rose by 500,000.

EDITOR
proc loan start=2014:12;

ballon amount=100000000 rate=15 life=144

ballonpayment=(18=1000000 46=500000)

label = 'BANK EKA, with Ballon Payment';

run;

RESULT
The SAS System

22:16 Thursday, June 12, 2016 1

The LOAN Procedure

Balloon Payment Loan Summary

BANK EKA, with Ballon Payment

62
Downpayment 0.00 Principal Amount 100000000.00

Initialization 0.00 Points 0.00

Total Interest 115287794.02 Nominal Rate 15.0000%

Total Payment 215287794.02 Effective Rate 16.0755%

Pay Interval MONTHLY Compounding MONTHLY

No. of Payments 144 No. of Compoundings 144

Start Date DEC2014 End Date DEC2026

Rates and Payments for BANK EKA, with Ballon Payment

Date Nominal Rate Effective Rate Payment

DEC2014 15.0000% 16.0755% 1484637.47

Balloon Period Payment

JUN2016 1000000.00

OCT2018 500000.00

installment payments per month for a loan with a balloon payment at


Rp.1.484.637,47 models and it turns out this installment Rp.16.239,3 lower than a
loan with a fixed rate loan. increase in payments described earlier ie in all 18
Rp.1.000.000 fell in June 2016 and amounted to 500,000 in the 46th falls on October
2018.

C. Adjustable Rate Loan


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. increase in interest each year
should not be more than 1% and over a period of a maximum loan interest rate
increase of 5%.

EDITOR
proc loan start=2014 : 12;

arm amount=100000000 rate=15 life=144 worstcase

caps=(1, 5)

label='BANK EKA, Adjustable Rate';

run;

RESULT
The SAS System

23:26 Thursday, June 12, 2016 1

The LOAN Procedure

Adjustable Rate Loan: Worst Case Analysis Summary

63
BANK EKA, Adjustable Rate

Downpayment 0.00 Principal Amount 100000000.00

Initialization 0.00 Points 0.00

Total Interest 146250750.55 Nominal Rate 15.0000%

Total Payment 246250750.55 Effective Rate 16.0755%

Pay Interval MONTHLY Compounding MONTHLY

No. of Payments 144 No. of Compoundings 144

Start Date DEC2014 End Date DEC2026

Rates and Payments for BANK EKA, Adjustable Rate

Date Nominal Rate Effective Rate Payment

DEC2014 15.0000% 16.0755% 1500876.77

JAN2016 16.0000% 17.2271% 1562233.48

JAN2017 17.0000% 18.3892% 1620843.24

JAN2018 18.0000% 19.5618% 1676315.59

JAN2019 19.0000% 20.7451% 1728216.04

JAN2020 20.0000% 21.9391% 1776058.68

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

BANK EKA, Buydown

Downpayment 0.00 Principal Amount 100000000.00

64
Initialization 0.00 Points 1000000.00

Total Interest 128270601.73 Nominal Rate 15.0000%

Total Payment 228270601.73 Effective Rate 16.0755%

Pay Interval MONTHLY Compounding MONTHLY

No. of Payments 144 No. of Compoundings 144

Start Date DEC2014 End Date DEC2026

Rates and Payments for BANK EKA, Buydown

Date Nominal Rate Effective Rate Payment

DEC2014 15.0000% 16.0755% 1500876.77

NOV2016 16.0000% 17.2271% 1559019.08

OCT2018 17.0000% 18.3892% 1610039.13

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.

8. Project Evaluations Under Certainty and Uncertainty

1. Open the SAS software.


2. Then the display will appear like this:

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.

In this example, the production manager of manufacturing companies plan to


bid on a project to produce a new type of machine. He has the option of bidding low
or high. The evaluation of the bids would be more beneficial if the bidder has built a
prototype. However, he was not sure about the cost of building the prototype. His
technical staff give the probability distribution for the cost of prototypes.

Table 7.33 Probability on the Cost of Building


Prototype

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

Table 7.34 Probability of Winning the Contract

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

Table 7.35 Payoffs of the Contract Bidding Decision

States Actions
Result Cost Bid low Bid high
Lose the Contract 0 0

Win the Contract $35000 $75000


Win the Contract Expensive $25000 $65000
Win the Contract Moderate $35000 $75000
Win the Contract Inexpensive $45000 $85000

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.

/* -- create the STAGEIN= data set -- */

data Stage3;

format _STNAME_ $14. _STTYPE_ $2. _OUTCOM_ $15.

_SUCCES_ $14. _REWARD_ dollar8.0 ;

input _STNAME_ $16. _STTYPE_ $4. _OUTCOM_ $16.

_SUCCES_ $16. _REWARD_ dollar8.0 ;

datalines;

Choose D Build_Prototype Cost_Prototype .

. . No_Prototype Bid .

Cost_Prototype C Expensive Bid -$4,500

. . Moderate Bid -$2,500

. . Inexpensive Bid -$1,000

Bid D High_Bid Contract .

. . 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.

/* -- create the PROBIN= data set -- */

data Prob3;

format _GIVEN1_ $15. _GIVEN2_ $15. _EVENT_ $14. ;

input (_GIVEN1_ _GIVEN2_ _EVENT_) ($) _PROB_;

datalines;

. . Expensive 0.4

. . Moderate 0.5

. . Inexpensive 0.1

Build_Prototype High_Bid Win_Contract 0.4

Build_Prototype High_Bid Lose_Contract 0.6

Build_Prototype Low_Bid Win_Contract 0.8

Build_Prototype Low_Bid Lose_Contract 0.2

No_Prototype High_Bid Win_Contract 0.2

No_Prototype High_Bid Lose_Contract 0.8

No_Prototype Low_Bid Win_Contract 0.7

No_Prototype Low_Bid Lose_Contract 0.3

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.

/* -- create the PAYOFFS= data set -- */

data Payoff3;

format _STATE1_ _STATE2_ $12.;

input (_STATE1_ _STATE2_ _ACTION_) ($16.)

_VALUE_ dollar8.0;

datalines;

Win_Contract . Low_Bid $35,000

Win_Contract . High_Bid $75,000

Win_Contract Expensive Low_Bid $25,000

Win_Contract Expensive High_Bid $65,000

Win_Contract Moderate Low_Bid $35,000

Win_Contract Moderate High_Bid $75,000

Win_Contract Inexpensive Low_Bid $45,000

69
Win_Contract Inexpensive High_Bid $85,000

The solution shown in 7.3.1, with the following code:

goptions ctext=black;

/* -- define title -- */

title1 h=2 "Contract Bidding Example" ;

/* -- PROC DTREE statements -- */

proc dtree stagein=Stage3 probin=Prob3 payoffs=Payoff3

graphics

nowarning

evaluate;

treeplot / name="dt3" compress ybetween=1 cell

hsymbol=3 ftext=swiss

lstyleb=3 lwidth=1 lwidthb=1;

quit;

Output 7.3.1 Decision Tree for the Contract Bidding Problem

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

A. Example 8.1: Uncapacitated Transportation Network

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.

title 'Uncapacitated Transportation Network';


data cst;
input Atlanta Chicago Denver Houston Los_Ange Miami
New_York San_Fran Seattle Washingt supply city$;
datalines;

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
;

proc trans cost=cst;


TAILNODE city;
HEADNODE Atlanta--Washingt;
SUPPLY supply;
run;
proc print;
run;

After this program executes, the following message is written to the SAS log:
NOTE: Optimal Solution total = 22928.

Output 8.1.1: Uncapacitated Transportation Network Solution

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.)

The macro variable _ORTRANS, defined by PROC TRANS, contains information


regarding the termination of the procedure. This information can be useful when
PROC TRANS is part of a larger SAS program. This information can be written to
the log using the macro language with the statement

%put &_ORTRANS;
The following message is written to the SAS log:
STATUS=SUCCESSFUL OBJECTIVE=22928

B. Example 8.2: Capacitated Transportation Network

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 trans cost=cst capacity=capcty;


HEADNODE Atlanta--Washingt;
TAILNODE city;
supply supply;
run;

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.

Output 8.2.1: Capacitated Transportation Network Solution

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.

2. THE ASSIGN PROBLEM


A. Example 2.1: Assigning Subcontractors to Construction Jobs

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.

The following statements produce Output 2.1.1:

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;

The cost of the optimal assignment is written to the SAS log:

NOTE: The maximum return assignment yields 814.

This means that the contractor can expect a profit of $814 if he follows the optimal
assignment.

Output 2.1.1: Assigning Subcontractors to Construction Jobs

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.

title 'Assigning Construction Jobs to Subcontractors';

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 assign maximum data=profit;


cost job1-job9;
id subcont;
run;

proc print;
sum _fcost_;
run;

The cost of the optimal assignment is written to the SAS log:

NOTE: The maximum return assignment yields 814.

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

The macro variable _ORASSIG defined by PROC ASSIGN contains information


regarding the termination of the procedure.

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;

On the log the following appears:

STATUS=SUCCESSFUL OBJECTIVE=814.

78
3. THENETWORK PROCEDURE

A. Example 11.2: Network Flow and Delay

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

f(x) = x24 + x34


The boundary constraints are

and the flow constraints are

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);

The optimal solution is shown in the following output.

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:

Figure 6.11: Simple Road Network

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.

Output 6.9.1: Iteration History

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

and the constraints are

85
Again, the default algorithm is used:

proc nlp all initial=.5;


min y;
parms x12 x13 x32 x24 x34;
bounds x12 x13 x32 x24 x34 >= 0;
lincon x13 = x32 + x34, /* flow in = flow out */
x12 + x32 = x24,
x24 + x34 = 5; /* = f = desired flow */
t12 = 5 + .1 * x12 / (1 - x12 / 10);
t13 = x13 / (1 - x13 / 30);
t32 = 1 + x32 / (1 - x32 / 10);
t24 = x24 / (1 - x24 / 30);
t34 = 5 + .1 * x34 / (1 - x34 / 10);
y = t12*x12 + t13*x13 + t32*x32 + t24*x24 + t34*x34;
run;

The iteration history is given in Output 6.9.3, and the optimal solution is given in Output
6.9.4.

Output 6.9.3: Iteration History

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.

Output 6.9.5: Linear Constraints at Solution

Output 6.9.6: Lagrange Multipliers at Solution

87
Output 6.9.7 shows that the projected gradient is very small, satisfying the first-order
optimality criterion.

Output 6.9.7: Projected Gradient at Solution

The projected Hessian matrix (shown in Output 6.9.8) is positive definite, satisfying the
second-order optimality criterion.

Output 6.9.8: Projected Hessian at Solution

4. THE CPM PROCEDURE


A. Example 2.11: Nonstandard Relationships

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.

Output 2.11.1: Network Data

Non-Standard Relationships
Activity Data Set WIDGLAG

Obs task days succ lagdur lagdurc

1 Approve Plan 5 Drawings

2 Approve Plan 5 Anal. Market

3 Approve Plan 5 Write Specs

4 Drawings 10 Prototype

5 Anal. Market 5 Mkt. Strat.

6 Write Specs 5 Prototype

7 Prototype 15 Materials ss_9 ss_9

8 Prototype 15 Facility ss_9 ss_9

9 Mkt. Strat. 10 Test Market

10 Mkt. Strat. 10 Marketing

11 Materials 10 Init. Prod.

12 Facility 10 Init. Prod. fs_2 fs_2_SEVENDAY

13 Init. Prod. 10 Test Market

14 Init. Prod. 10 Marketing

15 Init. Prod. 10 Evaluate

16 Evaluate 10 Changes

17 Test Market 15 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.

proc cpm data=widglag date='1dec03'd


interval=weekday collapse out=lagsched;
activity task;
succ succ / lag = (lagdur);
duration days;
run;

Output 2.11.2: Project Schedule: Default LAG Calendar

Non-Standard Relationships
Lag Type and Duration: Default LAG Calendar

task E_START E_FINISH L_START L_FINISH T_FLOAT F_FLOAT

Approve Plan 01DEC03 05DEC03 01DEC03 05DEC03 0 0

Drawings 08DEC03 19DEC03 08DEC03 19DEC03 0 0

Anal. Market 08DEC03 12DEC03 13JAN04 19JAN04 26 0

Write Specs 08DEC03 12DEC03 15DEC03 19DEC03 5 5

Prototype 22DEC03 09JAN04 22DEC03 09JAN04 0 0

Mkt. Strat. 15DEC03 26DEC03 20JAN04 02FEB04 26 26

Materials 02JAN04 15JAN04 06JAN04 19JAN04 2 2

Facility 02JAN04 15JAN04 02JAN04 15JAN04 0 0

Init. Prod. 20JAN04 02FEB04 20JAN04 02FEB04 0 0

Evaluate 03FEB04 16FEB04 10FEB04 23FEB04 5 5

Test Market 03FEB04 23FEB04 03FEB04 23FEB04 0 0

Changes 24FEB04 01MAR04 24FEB04 01MAR04 0 0

Production 02MAR04 02MAR04 02MAR04 02MAR04 0 0

Marketing 03FEB04 03FEB04 02MAR04 02MAR04 20 20

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.

proc cpm data=widglag date='1dec03'd calendar=calendar


interval=weekday collapse out=lagsched;
activity task;
succ succ / lag = (lagdurc);
duration days;
run;

Output 2.11.3: Calendar Data Set

Non-Standard Relationships
Calendar Data Set

Obs _cal_ _sun_ _mon_ _tue_ _wed_ _thu_ _fri_ _sat_

1 SEVENDAY workday workday workday workday workday workday workday

91
Output 2.11.4: Project Schedule: Lag Type, Duration, and Calendar

Non-Standard Relationships
Lag Type, Duration, and Calendar

task E_START E_FINISH L_START L_FINISH T_FLOAT F_FLOAT

Approve Plan 01DEC03 05DEC03 02DEC03 08DEC03 1 0

Drawings 08DEC03 19DEC03 09DEC03 22DEC03 1 0

Anal. Market 08DEC03 12DEC03 12JAN04 16JAN04 25 0

Write Specs 08DEC03 12DEC03 16DEC03 22DEC03 6 5

Prototype 22DEC03 09JAN04 23DEC03 12JAN04 1 0

Mkt. Strat. 15DEC03 26DEC03 19JAN04 30JAN04 25 25

Materials 02JAN04 15JAN04 05JAN04 16JAN04 1 1

Facility 02JAN04 15JAN04 05JAN04 16JAN04 1 1

Init. Prod. 19JAN04 30JAN04 19JAN04 30JAN04 0 0

Evaluate 02FEB04 13FEB04 09FEB04 20FEB04 5 5

Test Market 02FEB04 20FEB04 02FEB04 20FEB04 0 0

Changes 23FEB04 27FEB04 23FEB04 27FEB04 0 0

Production 01MAR04 01MAR04 01MAR04 01MAR04 0 0

Marketing 02FEB04 02FEB04 01MAR04 01MAR04 20 20

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 ' ';

proc gantt graphics data=lagsched logic=widglag;


chart / compress act=task succ=(succ) dur=days
font=swiss
cprec=black cmile=blue
caxis=black cfram=cyan
height=1.5 skip=2 nojobnum
dur=days increment=7 lag=(lagdur);
id task;
run;

Output 2.11.5: Project Schedule: LAG Calendar = SEVENDAY

Non-Standard Relationships
Lag Type and Duration: LAG Calendar = SEVENDAY

task E_START E_FINISH L_START L_FINISH T_FLOAT F_FLOAT

Approve Plan 01DEC03 05DEC03 01DEC03 05DEC03 0 0

Drawings 08DEC03 19DEC03 08DEC03 19DEC03 0 0

Anal. Market 08DEC03 12DEC03 09JAN04 15JAN04 24 0

Write Specs 08DEC03 12DEC03 15DEC03 19DEC03 5 5

Prototype 22DEC03 09JAN04 22DEC03 09JAN04 0 0

Mkt. Strat. 15DEC03 26DEC03 16JAN04 29JAN04 24 24

Materials 31DEC03 13JAN04 02JAN04 15JAN04 2 2

Facility 31DEC03 13JAN04 31DEC03 13JAN04 0 0

Init. Prod. 16JAN04 29JAN04 16JAN04 29JAN04 0 0

Evaluate 30JAN04 12FEB04 06FEB04 19FEB04 5 5

Test Market 30JAN04 19FEB04 30JAN04 19FEB04 0 0

Changes 20FEB04 26FEB04 20FEB04 26FEB04 0 0

Production 27FEB04 27FEB04 27FEB04 27FEB04 0 0

Marketing 30JAN04 30JAN04 27FEB04 27FEB04 20 20

Output 2.11.6: Precedence Gantt Chart

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.

The calendar PROD_CAL follows a more complicated work pattern: Sunday is a


holiday; on Monday work is done from 8 a.m. through midnight with a two hour

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.

Output 2.10.1: Workday and Calendar Data Sets

Multiple Calendars
Workdays Data Set

Obs fullday halfday ovtday s1 s2 s3

1 8:00 8:00 8:00 . 8:00 .

2 16:00 12:00 18:00 6:00 18:00 6:00

3 . . . 8:00 20:00 8:00

4 . . . 18:00 . 18:00

5 . . . 20:00 . .

6 . . . . . .

Multiple Calendars
CALENDAR Data Set

Obs cal _sun_ _mon_ _tue_ _wed_ _thu_ _fri_ _sat_

1 DEFAULT holiday fullday fullday fullday fullday fullday holiday

2 OVT_CAL holiday ovtday ovtday ovtday ovtday ovtday halfday

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.

Output 2.10.2: Holiday Data Set

Multiple Calendars
Holidays Data Set

Obs holiday holifin holidur

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.

goptions hpos=160 vpos=25 ftext=swiss;


title h=1.5 'Multiple Calendars';
title2 'Breaks and Holidays for the Different Calendars';
proc gantt data=cals graphics
calendar=calendar holidata=holidays
workday=workdata;
chart / interval=dtday mininterval=dthour skip=2
holiday=(holiday) holifin=(holifin)
markbreak daylength='08:00't calid=cal
ref='1dec03:00:00'dt to '4jan04:08:00'dt by dtday
nolegend nojobnum increment=16
hpages=6;
id cal;
run;

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;

proc cpm date='01dec03'd data=widgcal out=scheddef


holidata=holidays daylength='08:00't
workday=workdata
calendar=calendar;
holiday holiday / holifin = holifin;
activity task;
duration days;
successor succ1 succ2 succ3;
run;

title2 'Project Schedule: Default calendar';


proc print;
var task days e_start e_finish l_start l_finish
t_float f_float;
run;

Output 2.10.4: Schedule Using Default Calendar

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.

proc cpm date='01dec03'd data=widgcal out=schedmc


holidata=holidays daylength='08:00't
workday=workdata
calendar=calendar;
holiday holiday / holifin = holifin;
activity task;
duration days;
successor succ1 succ2 succ3;
calid cal;
run;

title2 'Project Schedule: Three Calendars';


proc print;
var task days cal e_: l_: t_float f_float;
run;

Output 2.10.5: Schedule Using Three Calendars

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.

Output 2.10.6: HOLIDATA and CALEDATA Data Sets

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.

/* Create a data set to illustrate holidays with PROC GANTT */


data cals2;
e_start='1dec03:00:00'dt;
e_finish='18dec03:00:00'dt;
label cal ='Schedule Breaks / Holidays';
format e_start e_finish datetime16.;
length cal $8.;
cal='DEFAULT' ; output;
cal='Eng_cal' ; output;
run;

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;

proc cpm date='01dec03'd data=widgvac out=schedvac


holidata=holidata daylength='08:00't
workday=workdata
calendar=caledata;
holiday holiday / holifin = holifin holidur=holidur;
activity task;
duration days;
successor succ1 succ2 succ3;
calid cal;
run;

102
title2 'Project Schedule: Four Calendars';
proc print;
var task days cal e_: l_: t_float f_float;
run;

Output 2.10.8: Schedule Using Four Calendars

5. THE NETFLOW PROCEDURE


A. Example 5.1: Shortest Path Problem

Whole pineapples are served in a restaurant in London. To ensure freshness, the


pineapples are purchased in Hawaii and air freighted from Honolulu to Heathrow in
London. The network diagram in Figure 5.26 outlines the different routes that the
pineapples could take.

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.

Figure 5.26: Pineapple Routes: Shortest Path 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.

title 'Shortest Path Problem';


title2 'How to get Hawaiian Pineapples to a London Restaurant';
data aircost1;
input ffrom&$13. tto&$15. _cost_ ;
datalines;
Honolulu Chicago 105
Honolulu San Francisco 75
Honolulu Los Angeles 68
Chicago Boston 45
Chicago New York 56
San Francisco Boston 71
San Francisco New York 48
San Francisco Atlanta 63
Los Angeles New York 44
Los Angeles Atlanta 57
Boston Heathrow London 88

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;

proc print data=spath;


sum _fcost_;
run;
The length at optimality is written to the SAS log as

NOTE: Number of nodes= 8 .


NOTE: Number of arcs= 13 .
NOTE: Number of iterations performed (neglecting any
constraints)= 5 .
NOTE: Of these, 4 were degenerate.
NOTE: Optimum (neglecting any constraints) found.
NOTE: Shortest path= 177 .
NOTE: The data set WORK.SPATH has 13 observations and 13
variables.

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.

Output 5.1.1: ARCOUT=SPATH

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.

title 'Minimum Cost Flow Problem';


title2 'How to get Hawaiian Pineapples to a London Restaurant';
proc netflow
defcapacity=350
sourcenode='Honolulu'
sinknode='Heathrow London' /* Quotes for embedded blank */
demand=500
arcdata=aircost1
arcout=arcout1
nodeout=nodeout1;
tail ffrom;
head tto;
set future1;
proc print data=arcout1; sum _fcost_;
proc print data=nodeout1;
run;

The following notes appear on the SAS log:

NOTE: SOURCENODE was assigned supply of the total


network demand= 500 .
NOTE: Number of nodes= 8 .
NOTE: Number of supply nodes= 1 .
NOTE: Number of demand nodes= 1 .
NOTE: Total supply= 500 , total demand= 500 .
NOTE: Number of arcs= 13 .
NOTE: Number of iterations performed (neglecting any
constraints)= 6 .
NOTE: Of these, 4 were degenerate.
NOTE: Optimum (neglecting any constraints) found.
NOTE: Minimal total cost= 93750 .
NOTE: The data set WORK.ARCOUT1 has 13 observations and
13 variables.
NOTE: The data set WORK.NODEOUT1 has 9 observations and
10 variables.

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.

Output 5.2.1: ARCOUT=ARCOUT1

Output 5.2.2: NODEOUT=NODEOUT1

108
6. TIMEPLOT PROCEDURE

A. EXAMPLE 1(FROM SAS MODUL)


EDITOR
data cotton;
input year US world @@;
label US='US COTTON PRODUCTION'
WORLD='WORLD COTTON PRODUCTION';
cards;
1940 12.6 31.2 1975 8.3 54.0
1950 10.0 30.6 1976 10.6 57.4
1960 14.2 46.2 1977 14.4 63.5
1965 15.0 55.0 1978 10.9 60.2
1970 10.2 53.6 1979 14.6 65.7
1972 13.7 62.9 1980 11.1 65.5
1973 13.0 63.3 1981 15.6 70.8
1974 11.5 64.3 1982 12.0 67.4
;
proc sort;
by year;
proc timeplot;
plot US WORLD / OVERLAY REF=MEAN (US WORLD) HILOC POS=64;
id YEAR;
Title'Trends in Cotton Production';
title2'Selected Year1940-1982';
title4'(Millions of Bales)';
run;

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;

NOTE: PROCEDURE TIMEPLOT used (Total process time):


real time 0.04 seconds
cpu time 0.04 seconds

RESULT

110
B. Example 1: Plotting a Single Variable (FROM SAS HELP)

Procedure features:
ID statement
PLOT statement arguments:

simple plot request

POS=

This example

uses a single PLOT statement to plot sales of refrigerators


specifies the number of print positions to use for the horizontal axis of the plot

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
;

proc timeplot data=sales;


plot icebox / pos=50;

id month week;

title 'Weekly Sales of Iceboxes';


title2 'for the';
title3 'First Six Weeks of the Year';
run;

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;

NOTE: The data set WORK.SALES has 12 observations and 5 variables.


NOTE: DATA statement used (Total process time):
real time 0.10 seconds
cpu time 0.09 seconds

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

Das könnte Ihnen auch gefallen