0% found this document useful (0 votes)
152 views

Tutorial: MSBA7003 Quantitative Analysis Methods

This document provides the solution to an assignment on quantitative analysis methods. It includes: 1) The solution to 4 questions from Assignment 03 on linear programming and worker scheduling. 2) An agenda for the tutorial covering causal inference, an example on maternal age and perinatal outcomes, and practice in R on wage and education data. 3) An explanation of the data envelopment analysis model used to evaluate the efficiency of 4 elementary schools based on inputs of mother's education, parent visits, and teacher-student ratio and outputs of reading, math, and self-esteem scores.

Uploaded by

Amanda Wang
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
152 views

Tutorial: MSBA7003 Quantitative Analysis Methods

This document provides the solution to an assignment on quantitative analysis methods. It includes: 1) The solution to 4 questions from Assignment 03 on linear programming and worker scheduling. 2) An agenda for the tutorial covering causal inference, an example on maternal age and perinatal outcomes, and practice in R on wage and education data. 3) An explanation of the data envelopment analysis model used to evaluate the efficiency of 4 elementary schools based on inputs of mother's education, parent visits, and teacher-student ratio and outputs of reading, math, and self-esteem scores.

Uploaded by

Amanda Wang
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

MSBA7003 Quantitative Analysis Methods

Tutorial 04
Haobo Yu
2021 – 2022

1
2

Agenda

• Solution to Assignment 03

• Causal Inference
• Maternal Age and Perinatal Outcomes

• Practice in R
• Wage and Education
3

Solution to Assignment 03
Q1. Consider the following linear programming problem.
max 𝑐′𝑥
s.t. 𝐴𝑥 ≤ 𝑏,
𝑥 ≥ 0,

𝑥1 3 10 30
3
where 𝑥 = 𝑥 , 𝑐 = , 𝐴 = 5 2 , and 𝑏 = 25 . Which of the following
2 1
2 0 8
statement(s) is(are) true?
A) The corner points of the feasible region are (x1, x2) = (0, 0), (0, 3), (4, 0),
and (4, 2).
B) The optimal solution is (x1, x2) = (4, 2).
C) There is a redundant constraint.
D) There are infinitely many optimal solutions.
E) None of the above.
4

Solution to Assignment 03
16

14

12

10
Constraint 1
x2

8
Constraint 2
6 Constraint 3
Isoprofit Line
4

2
Feasible Region
0
0 2 4 6 8 10 12
x1

• Constraint 1: 3𝑥1 + 10𝑥2 ≤ 30; constraint 2: 5𝑥1 + 2𝑥2 ≤ 25;


constraint 3: 2𝑥1 ≤ 8; isoprofit line: 3𝑥1 + 𝑥2 = 13.8
• Corner points: (0,0), (0,3), (4,0) and (4, 1.8)
• Constraint 2 is redundant; only (4, 1.8) is optimal.
• Choice (C) is correct.
5

Solution to Assignment 03
• Q2. Consider the worker scheduling problem in the lecture notes.
Suppose that the post office can force employees to work one day of
overtime each week on the day immediately following this five-day
shift. For example, an employee whose regular shift is Monday to
Friday can also be required to work on Saturday. Each employee is
paid $100 a day for each of the first five days worked during the week
and $124 for the overtime day (if any). The goal of the post office is
to minimize the cost of meeting its weekly work requirements.
• Which of the following statement(s) is(are) true?
• Note that there could be multiple optimal solutions, please select the
option(s) that can admit an optimal solution.
6

Solution to Assignment 03
• Decision variables:
• 𝑋𝑖 : number of employees whose first working day is day 𝑖
• 𝑌𝑖 : number of employees working overtime on day 𝑖
• 𝑖 = 0,1, … , 6. 0: Sunday, 1: Monday, 2: Tuesday, …, 6: Saturday.
• Constraints:
• Monday: 𝑋1 + 𝑋4 + 𝑋5 + 𝑋6 + 𝑋0 + 𝑌1 ≥ 17
• Tuesday: 𝑋1 + 𝑋2 + 𝑋5 + 𝑋6 + 𝑋0 + 𝑌2 ≥ 13
• Wednesday: 𝑋1 + 𝑋2 + 𝑋3 + 𝑋6 + 𝑋0 + 𝑌3 ≥ 15
• Thursday: 𝑋1 + 𝑋2 + 𝑋3 + 𝑋4 + 𝑋0 + 𝑌4 ≥ 19
• Friday: 𝑋1 + 𝑋2 + 𝑋3 + 𝑋4 + 𝑋5 + 𝑌5 ≥ 14
• Saturday: 𝑋2 + 𝑋3 + 𝑋4 + 𝑋5 + 𝑋6 + 𝑌6 ≥ 16
• Sunday: 𝑋3 + 𝑋4 + 𝑋5 + 𝑋6 + 𝑋0 + 𝑌0 ≥ 11
• 𝑌𝑖 ≤ 𝑋𝑖+2 𝑚𝑜𝑑 7 for all 𝑖 = 0, 1, … , 6
• Nonnegativity constraints
7

Solution to Assignment 03
• Objective value
• Monday cost: 𝐶1 = 100 𝑋1 + 𝑋4 + 𝑋5 + 𝑋6 + 𝑋0 + 124𝑌1
• Tuesday cost: 𝐶2 = 100 𝑋2 + 𝑋5 + 𝑋6 + 𝑋0 + 𝑋1 + 124𝑌2
• Wednesday cost: 𝐶3 = 100 𝑋3 + 𝑋6 + 𝑋0 + 𝑋1 + 𝑋2 + 124𝑌3
• Thursday cost: 𝐶4 = 100 𝑋4 + 𝑋0 + 𝑋1 + 𝑋2 + 𝑋3 + 124𝑌4
• Friday cost: 𝐶5 = 100 𝑋5 + 𝑋1 + 𝑋2 + 𝑋3 + 𝑋4 + 124𝑌5
• Saturday cost: 𝐶6 = 100 𝑋6 + 𝑋2 + 𝑋3 + 𝑋4 + 𝑋5 + 124𝑌6
• Sunday cost: 𝐶7 = 100 𝑋0 + 𝑋3 + 𝑋4 + 𝑋5 + 𝑋6 + 124𝑌0
• Total cost: min 𝐶1 + 𝐶2 + 𝐶3 + 𝐶4 + 𝐶5 + 𝐶6 + 𝐶0
• There are multiple solutions.
• If there exists one optimal solution that satisfies a choice’s statement,
this choice is correct.
8

Solution to Assignment 03
• To check the correctness of a choice, we can fix the corresponding
variable in the Excel model and solve the problem again by changing
other variables. Then check whether the objective value is still
optimal.
• For choice (A), there is no additional constraint, and the optimal
value is $10,740.
• For choice (B), the additional constraint is 𝑋1 = 6 and the new
minimum cost is $10,740.
• For choice (C), the additional constraint is 𝑌1 = 4 and the new
minimum cost is $10,988.
• For choice (D), the additional constraint is 𝑋5 = 0 and the new
minimum cost is $10,740.
• Finally, we can find that choice (B) and choice (D) are correct.
9

Solution to Assignment 03
• Q3. The Heinlein and Krampf Brokerage firm is instructed by a client to
invest $250,000 among five possible securities as shown in the table below.
The return of each security is uncertain and depends on the market
condition.
• The invested value is different with the budget.
Projected Return (%) in a bearish market in a bullish market

Los Angeles municipal 1.1 2.3


bonds
Thompson Electronics, Inc. -5.0 6.8

United Aerospace Corp. -1.7 4.9

-0.3 8.4
Palmer Drugs
Happy Days Nursing Homes -10.5 11.8
10

Solution to Assignment 03

• Decision variables: 𝑋𝑖 : the number of dollars invested in 𝑖th stock (1: Los
Angeles municipal bounds; 2: Thompson Electronics, Inc; 3: United
Aerospace Corp; 4: Palmer Drugs; 5:Happy Days Nursing Homes.)

• Objective: max minሼ1.1𝑋1 − 5𝑋2 − 1.7𝑋3 − 0.3𝑋4 − 10.5𝑋5 , 2.3𝑋1 +


6.8𝑋2 + 4.9𝑋3 + 8.4𝑋4 + 11.8𝑋5 ሽ.

• Since 𝑋𝑖 ≥ 0, the objective is equivalent with max 1.1𝑋1 − 5𝑋2 −


1.7𝑋3 − 0.3𝑋4 − 10.5𝑋5
11

Solution to Assignment 03
• Constraints:
• Municipal bonds should constitute at least 20% of the invested value:
𝑋1 ≥ 0.2 𝑋1 + 𝑋2 + 𝑋3 + 𝑋4 + 𝑋5
• At least 40% of the invested value should be placed in a combination of
electronic firms, aerospace firms, and drug manufacturers:
𝑋2 + 𝑋3 + 𝑋4 ≥ 0.4 𝑋1 + 𝑋2 + 𝑋3 + 𝑋4 + 𝑋5
• No more than 50% of the amount invested in municipal bonds should be
placed in a high-risk, high-yield nursing home stock:
𝑋5 ≤ 0.5𝑋1
• The investment in no single security can exceed 30% of the total budget:
𝑋𝑖 ≤ 0.3 ∗ 250000 for 𝑖 = 1,2, … , 5.
• No short selling, and it is okay to hold some cash:
𝑋1 + 𝑋2 + 𝑋3 + 𝑋4 + 𝑋5 ≤ 250000
𝑋1 , 𝑋2 , 𝑋3 , 𝑋4 , 𝑋5 ≥ 0
12

Solution to Assignment 03

• Solving it through EXCEL, we can find

• (A), (B) and (C) are correct.


13

Solution to Assignment 03
• For choice (D), 𝑋1 ≤ 0.3 ∗ 250000 is binding.
14

Solution to Assignment 03
• Q4. The Salem Board of Education wants to evaluate the efficiency of the town’s
four elementary schools. The three outputs of these schools are: (1) average
reading score, (2) average mathematics score, and (3) average self-esteem score.
The three inputs to these schools are: (1) average educational level of mothers
(defined by highest grade completed: 12 = high school graduate, 16 = college
graduate, and so on), (2) number of parent visits to school (per child), and (3)
teacher-to-student ratio. The relevant information for the four schools is given in
the table below.
School Input 1 Input 2 Input 3 Output 1 Output 1 Output 3

A 14.5 3 0.25 3.5 2.7 3

B 13 2 0.13 3.3 2.5 2.4

C 15.5 4 0.28 3.8 3 3.3

D 16.2 3 0.33 4 3.8 4


15

Solution to Assignment 03

• Let 𝑋1 , 𝑋2 , 𝑋3 , 𝑌1 , 𝑌2 , and 𝑌3 denote the coefficients of Input 1, Input 2, Input 3,


Output 1, Output 2, and Output 3, respectively. Let 𝑊𝐴 , 𝑊𝐵 , 𝑊𝐶 , and 𝑊𝐷 denote
the weights of school A, B, C, and D, respectively.
𝑋1 𝑌1 14.5 13 15.5 16.2
• 𝑋 = 𝑋2 ; 𝑌 = 𝑌2 ; 𝐼𝐴 = 3 ; 𝐼𝐵 = 2 ; 𝐼𝐶 = 4 ; 𝐼𝐷 = 3 ; 𝑂𝐴 =
𝑋3 𝑌3 0.25 0.13 0.33
𝑊𝐴0.28 14.5 3
3.5 3.3 3.8 4 𝑊𝐵 13 ; 𝐼 = 2 ;
2.7 ; 𝑂𝐵 = 2.5 ; 𝑂𝐶 = 3 ; 𝑂𝐷 = 3.8 ; 𝑊 = 𝑊 ; 𝐼1 =
𝐶 15.5 2 3
3 2.4 3.3 4
𝑊𝐷 16.2 3
0.25 3.5 2.7 3
𝐼3 = 0.13 ; 𝑂1 = 3.3 ; 𝑂2 = 2.5 ; 𝑂3 = 2.4 .
0.28 3.8 3 3.3
0.33 4 3.8 4

• We take school A as example. For school B, C, and D, the solving process is similar.
16

Solution to Assignment 03
• If we assume constant returns to scale, we build the
following model to check whether school A is efficient or
not.
• Targets: max 𝑂𝐴 ′𝑌
𝑋,𝑌
• Decision variables: 𝑋1 , 𝑋2 , 𝑋3 , 𝑌1 , 𝑌2 , and 𝑌3 .
• Constraints:
𝐼𝐴 ′𝑋 = 1,
𝑂𝐴′ 𝑌 ≤ 𝐼𝐴′ 𝑋,
𝑂𝐵′ 𝑌 ≤ 𝐼𝐵′ 𝑋,
𝑂𝐶′ 𝑌 ≤ 𝐼𝐶′ 𝑋,
𝑂𝐷′ 𝑌 ≤ 𝐼𝐷′ 𝑋,
𝑋, 𝑌 ≥ 0.
• Let 𝑌 ∗ denote the optimal weights. If 𝑂𝐴′ 𝑌 ∗ = 1, school A is
efficient; otherwise, it is not efficient.
17

Solution to Assignment 03
• If we assume non-constant returns to scale, we build the following
model to check whether school A is efficient or not.
• Targets: max 𝐾
𝑊,𝐾
• Decision variables: 𝑊𝐴 , 𝑊𝐵 , 𝑊𝐶 , 𝑊𝐷 , and 𝐾.
• Constraints:
𝑊𝐴 + 𝑊𝐵 + 𝑊𝐶 + 𝑊𝐷 = 1,
𝐼1′ 𝑊 ≤ 14.5,
𝐼2′ 𝑊 ≤ 3,
𝐼3′ 𝑊 ≤ 0.25,
𝑂1′ 𝑊 ≥ 3.5𝐾,
𝑂2′ 𝑊 ≥ 2.7𝐾,
𝑂3′ 𝑊 ≥ 3𝐾,
𝑊 ≥ 0.
• Under the optimal solution, if 𝐾 = 1, school A is efficient;
otherwise, it is not efficient.
18

Solution to Assignment 03

• Therefore, option E is correct.


19

Maternal Age and Perinatal Outcomes


• We are studying the mechanisms underlying the association between
obesity and adverse perinatal outcomes (Pre-eclampsia). We assume
that the causal graph is correct (i.e., there are no other variables
(nodes) or arrows that should be included).
20

Maternal Age and Perinatal Outcomes


• Scenario 1 Assume that current knowledge does not imply a
plausible effect of addictive personality on smoking or obesity, or
that there is a direct relationship of SEP to PE risk, so these
relationships (all shown with dashed arrows) are not included in the
causal graph in Scenario 1.
• How to obtain a valid estimate of the causal effect of obesity on PE.
21

Maternal Age and Perinatal Outcomes

• Unblocked backdoor paths


• PE-Age at pregnancy-SEP-Smoking-Obesity;
• PE-Age at pregnancy-SEP-Obesity;
• PE-Age at pregnancy-Smoking-Obesity;
• PE-Smoking-Obesity.
• There is also one blocked path
• PE-Age at pregnancy -Smoking-SEP-Obesity; this is blocked because age and
SEP collide on smoking.
• To block the path, PE-Smoking-Obesity, we must condition on
“smoking”
• When we do that, a “spurious” association between Pregnancy age
and SEP is generated. This new path is different from the above path,
i.e., PE-Age at pregnancy-SEP-Obesity.
22

Maternal Age and Perinatal Outcomes

• However, blocking the original path will block the generated path. To
do this, we can condition on either condition on age at pregnancy or
SEP
• To conclude, if we assume the causal graph is correct, then
conditioning on pregnancy age (or SEP) and smoking will provide a
valid causal estimate.
23

Maternal Age and Perinatal Outcomes

• Scenario 2 New research/knowledge provides evidence that: (a)


Addictive personality is relevant to our causal understanding of
obesity on PE and must be added to the causal graph as shown with
dashed arrows (related to smoking and obesity) and (b) SEP is directly
related to PE.
24

Maternal Age and Perinatal Outcomes


• This introduces several unblocked paths (in addition to the ones
above):
• PE-SEP-Obesity (For this path, we must condition on SEP)
• PE-SEP-Smoking-Obesity
• PE-SEP-Age at pregnancy-Smoking-Obesity
• PE-Smoking-Addictive personality-Obesity
• This introduces one new blocked path:
• PE-SEP-Smoking-Addictive personality-Obesity.
• We also still need to condition on smoking to block the paths
described in scenario 1. But when we condition on smoking, we
create some spurious associations among SEP, smoking, and age at
pregnancy and introduce the following paths:
• PE-SEP-Addictive personality-Obesity;
• PE-Age at pregnancy-SEP-Addictive personality-Obesity;
• PE-Age at pregnancy-Addictive personality-Obesity (For this, we must
condition on age at pregnancy)
• This time we must condition on smoking, SEP, and Age at pregnancy.
25

Maternal Age and Perinatal Outcomes

• Should we condition on gestational age in either scenario?


• To do so potentially introduces a “spurious” association between
Obesity and PE.

• Spurious association would be inverse (or consistent) and so this


‘collider’ bias could produce an effect estimate that is weaker (or
stronger) than true positive effect.
26

Wage and Education

• Data Description
• wage Wife's 1975 average hourly earnings, in
dollars
• educ Wife's educational attainment, in years
• exper Actual years of wife's previous labor
market experience
• mothereduc wife's mother's education level
• fathereduc wife's father's education level
• lfp dummy variable = 1 if woman worked in 1975,
else 0
27

Wage and Education

• Data Description
28

Wage and Education

• Consider the 𝑤𝑎𝑔𝑒 model in the following equation


log 𝑤𝑎𝑔𝑒 = 𝛽1 + 𝛽2 𝑒𝑑𝑢𝑐 + 𝛽3 𝑒𝑥𝑝𝑒𝑟 + 𝛽4 𝑒𝑥𝑝𝑒𝑟 2 + 𝑒
• The notorious difficulty with this model is that the error term may
include some unobserved attributes, such as personal ability, that
determine both wage and education. In other words, the
independent variable 𝑒𝑑𝑢𝑐 is correlated with the error term, is
endogenous
• An instrument that may address the endogeneity of 𝑒𝑑𝑢𝑐 is
𝑚𝑜𝑡ℎ𝑒𝑟𝑒𝑑𝑢𝑐, of which we can reasonably assume that is does not
directly influence the daughter’s wage, but it influences her
education.
29

Wage and Education

• Explicit two-stage model with only one instrument, 𝑚𝑜𝑡ℎ𝑒𝑟𝑒𝑑𝑢𝑐.


The first stage is regress 𝑒𝑑𝑢𝑐 on other regressors and the
instrument,
𝑒𝑑𝑢𝑐 = 𝛾1 + 𝛾2 𝑒𝑥𝑝𝑒𝑟 + 𝛾3 𝑒𝑥𝑝𝑒𝑟 2 + 𝜃1 𝑚𝑜𝑡ℎ𝑒𝑟𝑒𝑑𝑢𝑐 + 𝑣𝑒𝑑𝑢𝑐
30

Wage and Education

• First stage in the 2SLS model for the ‘wage’ equation

• The 𝑝-value for 𝑚𝑜𝑡ℎ𝑒𝑟𝑒𝑑𝑢𝑐 is very low, indicating a strong


correlation between this instrument and the endogenous variable
𝑒𝑑𝑢𝑐 even after controlling for other variables.
31

Wage and Education

• The second stage is to create the fitted values of 𝑒𝑑𝑢𝑐 from the first
stage and plug them into the model of interest to replace the original
variable 𝑒𝑑𝑢𝑐.
32

Wage and Education

• Second stage in the 2SLS model for the ‘wage’ equation

• The standard errors calculated in this way are incorrect; the correct
method is to use a dedicated software function to solve an
instrumental variable model. In R, such a function is ivreg().
33

Wage and Education

• Consider one more instrumental variable: 𝑓𝑎𝑡ℎ𝑒𝑟𝑒𝑑𝑢𝑐


34

Wage and Education


• The results of diagnostic tests

• Weak instruments test rejects the null, meaning that at least


one instrument is strong
• (Wu-)Hausman test for endogeneity barely rejects the null that
the variable of concern is uncorrelated with the error term,
indicating that 𝑒𝑑𝑢𝑐 is marginally endogenous
• Sargan test (overidentifying restrictions) does not reject the null,
meaning that the extra instruments are valid (are uncorrelated
with the error term).

You might also like