sas代写-ECON30025/ECOM90020
时间:2022-06-28
ECON30025/ECOM90020 Semester 1, 2022
Page 1 of 12
The University of Melbourne, Semester 1 Assessment 2022
Department of Economics,
ECON30025/ECOM90020

Computational Economics and Business

Writing time 2 hours or 120 minutes. Reading time 30 minutes. Time to complete
submission 30 minutes. Total time 180 minutes.

This paper comprises 60% of the assessment for students in ECON30025 and 50% for those enrolled in
ECOM90020. This exam has a total of 100 marks and will be scaled differently for students in the
different subjects. The exam has 4 questions and 12 pages. All students in both subjects are required to
answer all parts of all questions. The distribution of marks for each question are listed below.
Question Marks
1 25
2 45
3 20
4 10
Total 100
Please be concise in your responses. Partial credit will be awarded for your responses so make sure to provide
partial answers when you need to. You must answer the question with complete sentences. Use equations and diagrams
when appropriate to illustrate your responses. If you are not sure of the conditions of the question state your
assumptions. If submitting a scanned document, try to write your answers in a neat hand and use black ink. You do not
need access to SAS for this exam. However, if you use any computer code it should be submitted with the answer.
Only a single pdf will be accepted. You need to name this with the format
FIRSTNAME_FAMILYNAME_STUDENT ID.pdf. Insert your code (if any used) after your answer for each
question.
This is an open book exam. You can use notes, textbooks or resource materials. However, this does not imply
that copies of materials from the internet without attribution will be considered viable answers. Also, be aware that the
Turnitin software will be used to check your submission (this does not apply to partial code copied from the lectures and
tutorials).
This is an online examination and thus must be submitted on or before the specified time. This exam requires file
uploads. These files may take some time to complete their upload in peak exam times. Students are permitted up to 30
minutes after the scheduled completion time to upload and check files. File uploads must be fully completed by this
time (for example, an exam scheduled at 10:00am with 120 minutes writing time + 30 minutes reading time + 30 minutes
of upload allowance will have a final completion time of 1:00pm). Students will not be able to make a submission after
this time. Students who were prevented from submitting on time or at all due to technical difficulties will need to apply
for technical/special consideration with supporting documentation.

There is a guide to submitting assignment type exams at:
https://students.unimelb.edu.au/your-course/manage-your-course/exams-assessments-and-results/exams/exam-
types#canvas-assignment. All exams will be moderated. Please log your concern via the Canvas chat board in the first
instance using the Big Blue Button. Alternatively, you can call the following numbers for assistance during the exam if
you are experiencing technical difficulties. Inside Australia: 13MELB (13 6352) (select Option 1 for current students then
select Option 1 again for exam enquiries). Outside Australia: +61 3 9035 5511 (select Option 1 for current students and
then select Option 1 again for exam enquiries) You will be able to contact your examiner during the examination reading
time. Do not contact your lecturer during the examination period.
This exam has 12 pages.
lOMoARcPSD|4999304
ECON30025/ECOM90020 Semester 1, 2022
Page 2 of 12
Question 1 (25pts) Short answer questions.
Answer the questions below with no more than 1 to 2 paragraphs.
1.A.(5 pts) Describe a simulation to summarize the performance of potential portfolios that are
defined by a combination of a set of 10 different investment options such as stocks and bonds. How would you
display the results?
1.B. (5 pts) Susan needs to pick up food orders from different restaurants and deliver them to
customers living in different apartments. Describe how she could plan her trip given the locations of the
restaurants, the size of the orders and the number of customers in each apartment so that she can make these
deliveries in the least amount of time (assume all orders weight the same).
1.C. (5 pts) To generate more employment opportunities for workers with only a secondary school
education how might a government determine the most "bang for their buck" when deciding on expenditures in
which industries they should make in a stimulus package? What term would you use to define the “bang for
buck” effect and why do they differ by type of government expenditure.
1.D (5 pts) A city has determined that each immunisation site they have can jab up to 350 people a
day. Describe how one could design a method to determine the number of sites needed to provide at least 1,200
a day given the probability distribution of the number of people who would arrive at the sites every minute of
the day. How could one determine a probability that they would achieve their goal with each number of sites?
1.E. (5 pts) A university needs to cut some subjects taught due to reductions in teaching staff. Given
that some subjects are prerequisites for more subjects than other subjects, describe a method they could use to
rank the subjects to increase the ability for students to complete their degrees?

Question 2 (45pts)
Consider the program listed below that reads a data set that lists the budgets and box office receipts for 1,000
films released worldwide and takes a 10% sample:
*
Q2_e_2022.sas
*/
options ls=80 ;
ods graphics on;
Title "Movie Budgets" ;
/*
Read Movie budget data from The Numbers website for 1000 films
*/
filename csvbudg url
"https://www.online.fbe.unimelb.edu.au/t_drive/ECOM/ECOM90020/data/Movie_budgets.csv"
termstr=crlf;
proc import datafile=csvbudg out=budgets1 replace dbms=csv; run;
*========================================================================================
A.

Title "Section A" ; run;

*---------------------------------------------------------------------------------------;
;
data budgets ; set budgets1(where=(worldwide>0)) ;
day = datepart(release);
datey = day ;
lOMoARcPSD|4999304
ECON30025/ECOM90020 Semester 1, 2022
Page 3 of 12
datem = day ;
budget = budget / 1e6 ;
worldwide = worldwide / 1e6 ;
domestic = domestic / 1e6 ;
lbudget = log(budget) ;
lww = log(worldwide) ;
if ranuni(969979) < .1 ;
non_US = worldwide - domestic ;
d_t_ww = domestic / non_US;
num = _n_ ;
format datey year4. datem monname10. day date7.;
label
order = rank of budget
datey = year of release
datem = month of release
worldwide = World-wide box office receipts (mill$)
Budget = Cost of the film (mill$)
domestic = US box office (mill$)
non_US = worldwide - domestic
d_t_ww = "(US / non_US) boxoffice" ;

run;
*======================================================================================;
B.

Title "Section B" ; run;

*---------------------------------------------------------------------------------------;

%macro DEA;

data &datause; set &datause;
c_n = _n_ ;
array xx &outputs &inputs ;
do over xx ; if xx >= 1 ; end ;
run;
*
Define the Proc IML routine as a macro named DEA
;
proc iml ;
*
Routine to perform the DEA estimation
;
constant = &constant ;
*
To read the data for the inputs and the outputs
;
USE &datause ;

READ ALL var{&outputs} INTO OPt [colname=op_names]; * Outputs ;
READ ALL var{&inputs } INTO INt [colname=in_names]; * Inputs ;
READ ALL var{&names} INTO ID1 [colname=id_names]; * DMU numbers ;
K = NCOL(INt); * Number of inputs ;
M = NCOL(OPt); * Number of outputs ;
*
Set the negative, zero and missing values to zero
;
ind1 = (((opt||int) <= 0)[,+]) > 0 ; * indicator vector for bad values;
op = opt-opt#ind1 ; in = int -int#ind1 ;
*
Run as the input min
lOMoARcPSD|4999304
ECON30025/ECOM90020 Semester 1, 2022
Page 4 of 12
;
cntl = j(8,1,.) ; cntl[1,] = 1 ; * Specifies a cost minimization ;
;
N = NROW(IN); * Number of DMUs ;

print N[colname={"#_of_DMUs"}] k[colname={"#_of_Inputs"}] m[colname={"#_of_Outputs"}];
*
Divide by the means to center the data
;
OP = OP/( J( N,1,1) * OP[:,] );
IN = IN/( J( N,1,1) * IN[:,] );
rel = j(m,1,'G')//j(k,1,'L') // 'E' ; * variable returns (fix) ;
if constant then rel = j(m,1,'G')//j(k,1,'L') ; * constant returns ;
*
Construct a new input vector after the initial efficiency scores
are computed. 1st time through compute the regular results.
;
flag_a = j(n,1,1) ; * define inclusion flag ;
*
Cycle over the dmus for the DEA results
;
if constant = 0 then A = OP`// IN`// J(1,N,1) ; * variable returns ;
else A = OP`// IN` ; * constant returns ;
do ii = 1 to N ;

c = {1} || j(1,N,0) ;

if constant = 0 then aa = ( j(m,1,0) // -in[ii,]`//{0} ) || a ; * variable returns ;
else aa = ( j(m,1,0) // -in[ii,]` ) || a ; * constant returns ;

if constant = 0 then b = op[ii,]` // j(k,1,0) // { 1 } ; * variable returns ;
else b = op[ii,]` // j(k,1,0) ; * constant returns ;
u = j(1,n+1,1) ;

call lpsolve(rc, value ,activ, dual, reducost, c, aa, b, cntl, rel,, ) ;

if value = 0 then eff = . ; else eff = value ;

if rc > 0 then do; print "termination reason = " rc; eff = . ; end;

teff = teff // eff ;

act_tot = act_tot // (id1[ii,]||eff||(activ`)) ;

end;

teff = teff ||j(n,1,constant)|| id1 || op_t || in_t ;

names1 = {"eff&constant" "ifconstant"}||id_names || op_names || in_names ;
names2 = id_names ;
*
Write out the efficiency measures and the full set of estimated weights
;
create teff&constant from teff[colname=names1] ;
setout teff&constant; append from teff ;
create act_tot&constant from act_tot ;
setout act_tot&constant; append from act_tot ;

quit; run;
*
Merge the efficiency data with the original data set
lOMoARcPSD|4999304
ECON30025/ECOM90020 Semester 1, 2022
Page 5 of 12
;
data new&constant ; merge &datause teff&constant(in=i1) ; by &names ;
if i1 ; run;
*
Find the efficient generators and put them into a data set called
e_&constant ;
;
data e_&constant ; set new&constant(where=(eff&constant=1)) ;
run ;

proc print data=e_&constant ; id &names &cnames;
var eff&constant &inputs &outputs ; run;

%mend DEA;
*======================================================================================;
/*
C.
*/
Title "Section C" ; run;

*---------------------------------------------------------------------------------------;
%let outputs = worldwide; ** List of outputs ;
%let inputs = budget ; ** List of inputs ;
%let datause = budgets ; ** Name of dataset to use ;
%let names = num ; ** DMU number of order on input file ;
%let cnames = name ; ** Alphanumeric DMU name on the input file ;
%let constant = 0 ; ** set to 1 for constant returns to scale problem ;
%let print = 0 ; ** set to 1 for listing of results by routine ;

%DEA ;
*======================================================================================;
/*
D.
*/
Title "Section D" ; run;

*---------------------------------------------------------------------------------------;
proc sgplot data=new&constant(where=(eff&constant<.5)) ;
scatter y=eff&constant x=&outputs/datalabel=&cnames ;
xaxis type=log logbase=10 logvtype=expanded;
run;

*======================================================================================;
/*
E.
*/
Title "Section E" ; run;

*---------------------------------------------------------------------------------------;
%let constant = 1 ;

%DEA ; * run the DEA macro again ;

proc sgplot data=new&constant(where=(eff&constant>.3)) ;
scatter y=eff&constant x=&inputs/datalabel=&cnames ;
xaxis type=log logbase=10 logvtype=expanded; run;
*======================================================================================;
/*
F.
*/
Title "Section F" ; run;
lOMoARcPSD|4999304
ECON30025/ECOM90020 Semester 1, 2022
Page 6 of 12

*---------------------------------------------------------------------------------------;
data total ; merge new1 new0 ; by &names ;
diff = eff0 - eff1 ;
run;

proc sgplot data=total ;
reg y=diff x = &inputs / degree=4;
xaxis type=log logbase=10 logvtype=expanded;
run;
*======================================================================================;
/*
G.
*/
Title "Section G" ; run;

*--------------------------------------------------------------------------------------;
data total1 ; set total ;
alt_eff = &outputs/&inputs ;
run;

proc sgplot data=total1;
reg y=eff0 x=alt_eff/legendlabel = "Variable" ;
reg y=eff1 x=alt_eff/legendlabel = "Constant" ; run;

*======================================================================================;
/*
H.
*/
Title "Section H" ; run;

*---------------------------------------------------------------------------------------;

proc reg data=total1(where=((.1< d_t_ww)&(d_t_ww < 1)));
model eff0 = d_t_ww ; run;



2.I (32 pts) Describe the process in each section of code A to H and interpret the results of these analysis
from the results listed below. Provide a separate answer for each section and number your answers: 2.I.A,
2.I.B, 2.I.C, 2.I.D, 2.I.E, 2.I.F, 2.I.G and 2.I.H. Each is worth 4pts.
2.II.A (4 pts) What are the advantages of this type of analysis?
2.II.B (4 pts) What are the disadvantages of this type of analysis?
2.II.C (2 pt) Describe how this analysis could be modified.
2.II.D (3 pt) How could we perform a further analysis of the results?


lOMoARcPSD|4999304
ECON30025/ECOM90020 Semester 1, 2022
Page 7 of 12

Log for Section A


Section C


N
#_of_DMUs
K
#_of_Inputs
M
#_of_Outputs
89 1 1

num name eff0 Budget Worldwide
165 Frozen II 1 150 1425.417354
695 Minions 1 74 1160.336173
868 Meet the Fockers 1 60 516.567575
986 Just Like Heaven 1 58 100.687083


54 data budgets ; set budgets1(where=(worldwide>0)) ;
55 day = datepart(release);
56 datey = day ;
57 datem = day ;
58 budget = budget / 1e6 ;
59 worldwide = worldwide / 1e6 ;
60 domestic = domestic / 1e6 ;
61 lbudget = log(budget) ;
62 lww = log(worldwide) ;
63 if ranuni(969979) < .1 ;
64 non_US = worldwide - domestic ;
65 d_t_ww = domestic / non_US;
66 num = _n_ ;
67 format datey year4. datem monname10. day date7.;
68 label
69 order = rank of budget
70 datey = year of release
71 datem = month of release
72 worldwide = World-wide box office receipts (mill$)
73 Budget = Cost of the film (mill$)
74 domestic = US box office (mill$)
75 non_US = worldwide - domestic
76 d_t_ww = "(US / non_US) boxoffice" ;
77
78 run;

NOTE: Division by zero detected at line 65 column 24.
order=851 Release=27OCT00:00:00:00 name=Lucky Numbers Budget=65
Domestic=10.014234 Worldwide=10.014234 ratio=0.154065138 day=27OCT00 datey=2000
datem=October lbudget=4.1743872699 lww=2.3040074809 non_US=0 d_t_ww=. num=843
_ERROR_=1 _N_=843
NOTE: Mathematical operations could not be performed at the following places.
The results of the operations have been set to missing values.
Each place is given by: (Number of times) at (Line):(Column).
1 at 65:24
NOTE: There were 991 observations read from the data set WORK.BUDGETS1.
WHERE worldwide>0;
NOTE: The data set WORK.BUDGETS has 89 observations and 15 variables.
NOTE: DATA statement used (Total process time):
real time 0.05 seconds
cpu time 0.03 seconds
lOMoARcPSD|4999304
ECON30025/ECOM90020 Semester 1, 2022
Page 8 of 12

Section D



Section E

N
#_of_DMUs
K
#_of_Inputs
M
#_of_Outputs
89 1 1

num name eff1 Budget Worldwide
695 Minions 1 74 1160.336173



lOMoARcPSD|4999304
ECON30025/ECOM90020 Semester 1, 2022
Page 9 of 12
Sections F and G



Section H




The REG Procedure
Model: MODEL1
Dependent Variable: eff0
Number of Observations Read 60
Number of Observations Used 60
Analysis of Variance
Source DF Sum of
Squares
Mean
Square
F Value Pr > F
Model 1 0.23143 0.23143 4.76 0.0332
Error 58 2.82028 0.04863
Corrected Total 59 3.05171
Root MSE 0.22051 R-Square 0.0758
Dependent Mean 0.64816 Adj R-Sq 0.0599
Coeff Var 34.02142
Parameter Estimates
Variable Label DF Parameter
Estimate
Standard
Error
t Value Pr > |t|
Intercept Intercept 1 0.48134 0.08159 5.90 <.0001
d_t_ww (US / non_US) boxoffice 1 0.28170 0.12913 2.18 0.0332

lOMoARcPSD|4999304
ECON30025/ECOM90020 Semester 1, 2022
Page 10 of 12
Question 3 (20 pts)
3.I The following code generates a data set with pseudo-random numbers.

data unif;
do ii = 1 to 5000 ;
do n = 1 to 100;
x = exp(rannor(9897));
x = x * ( ( ( ranuni(9875) < .55 ) * 10 ) - 5) ;
output ;
end;
end;
run;

3.I.A (3pts) What random process defines the variable x? Describe the random number generator used by this
code. What are the potential drawbacks of the random variables created by this code.
3.I.B (2pts) Describe what the unif dataset looks like that was created by this code. What are the variables in
the dataset. How many observations are generated by this code?

3.II. The code below uses the results of the code in part 3.I and generates a histogram as follows

proc summary data=unif;
by ii ;
var x ;
output out=meddist median=medvalue mean=meanvalue;
run;

proc univariate data=meddist;
var medvalue meanvalue;
histogram / midpoints=-4.5 to 4.5 by 0.05;
run;

3.II. A(5pts) Explain what each main component of the code below does and describe what these graphs show
and why they are shaped as they are.


lOMoARcPSD|4999304
ECON30025/ECOM90020 Semester 1, 2022
Page 11 of 12
3.II.(10pts) Continuing part II


3.II.A(4pts) Describe what the listed below code does when it follows the code in part I.

proc kde data=meddist;
univar medvalue/ out=kde1 cdf ngrid=2000 ;
univar meanvalue/ out=kde2 cdf ngrid=2000 ;
run;
title " " ;

data total ; set kde1 kde2 ; run;

proc sgplot data=total ;
series y=distribution x=value / group= var ;
refline .025 .05 .1 .5 .9 .95 .975 / axis=y ;
yaxis values=( 0 to 1 by .05 );
xaxis values=( -3.4 to 4.4 by .2 ) grid ;
run;

This code generates the plot shown below:

Using this plot answer the following questions:

3.II.B(3pts) What would be the 95% confidence interval for the median of x in the dataset unif. What sort of
interval is this?

3.II.C(3pts) What would be the 95% confidence interval for the mean of x in the dataset unif. What sort of
interval is this?

lOMoARcPSD|4999304
ECON30025/ECOM90020 Semester 1, 2022
Page 12 of 12
Question 4 (10 pts)

Consider a Leslie population model for the female population with two states: young (1) and old (2). When a
female is young, the probability of giving birth to a young female is given as a. The young female becomes an
old female next period with a survival probability of 1. An old female does not give birth to any child and her
survival probability is b. Let x1 and x2 denote the size of the young and old female population, respectively.

4.I (3pts) Write down the model as a Markov model with two states.

4.II (3pts) How many individuals enter into the population each period, and how many leave the population
each period?

4.III (4pts) Derive the general formulae that predict the levels of x1,t+k and x2,t+k given x1t and x2t. (Hint: this
part requires more work than part (a) or (b). Plan your time accordingly.)


(END OF EXAM)
lOMoARcPSD|4999304
essay、essay代写