DADM Homework 3

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 7

Sichuan University

Homework 3 (100 points)

Course Name:Data Analysis and Decision Making Lecturer:


Student Name:
Score: _______________

1. Please use Excel to do a quadratic regression based on the 2009-2019 Tmall “Double Eleven” Day
GMV data, and explain the detailed process and results (including estimated parameters, R 2) with
screenshot. (50 points)

Ans:
(1) Assume x=1 and y=0.52 (RMB 108) in Year 2009, and x=2 and y=9.36 (RMB 108) in
Year 2010, and so on
Year x y
2009 1 0.52
2010 2 9.36
2011 3 52
2012 4 191
2013 5 352
2014 6 571
2015 7 912
2016 8 1207
2017 9 1682.69
2018 10 2135
2019 11 2684
(2) Insert a new column to calculate x^2
x x^2 y
1 1 0.52
2 4 9.36
3 9 52
4 16 191
5 25 352
x x^2 y
6 36 571
7 49 912
8 64 1207
9 81 1682.69
10 100 2135
11 121 2684
(3) In the tab of Data, click on Data Analysis

(4) The Regression and OK

(5) Choose the data range


(6) Select “Label” checkbox and then click OK

(7) The Result:


SUMMARY OUTPUT

Regression Statistics
Multiple R 0.999814346
R Square 0.999628726
Adjusted R Square 0.999535907
Standard Error 20.03197
Observations 11

ANOVA
df SS MS F Significance F
Regression 2 8643328.753 4321664.377 10769.70268 1.90012E-14
Residual 8 3210.238578 401.2798222
Total 10 8646538.992

Coefficients Standard Error t Stat P-value Lower 95% Upper 95% Lower 95.0% Upper 95.0%
Intercept 72.35533333 21.99926784 3.288988245 0.011038692 21.62493072 123.0857359 21.62493072 123.0857359
x -95.28182517 8.425892288 -11.3082178 3.36622E-06 -114.7119676 -75.85168272 -114.7119676 -75.85168272
x^2 30.2159324 0.68388018 44.18307956 7.59934E-11 28.63890188 31.79296292 28.63890188 31.79296292

So, we can get the quadratic regression model for the above historical data is:
y = 30.22x^2 – 95.28x + 72.36
R^2 = 0.9996, which mean 99.96% of y (GMV) can be explained by x-variables (year)

(Results were round up)


2. Consider the simplified diet problem. Suppose a person need to eat apples and bananas every day.
Both of the two types of food contain protein, vitamin C, and iron. The minimal daily diet
requirement for a person as well as the cost for buying the two types of food are shown in the
following table. Please build the mathematical programming for minimizing the cost, and use Excel
to solve the problem and show the screenshot of your results. (50 points)

Ans:
Suppose that: x1 and x2 are the quantity consumed of Apples and Bananas respectively to
minimize the cost.
Based on the Minimal Daily Diet Requirement,
(1) 0.4x1 + 1.2x2 >= 70
(2) 6x1 + 10x2 >= 50
(3) 0.4x1 + 0.6x2 >= 12
(4) 8x1 + 10x2 is minimal
(5) x1, x2 >= 0

Run programming on Excel, we have the result:


Foods Me asure of a Unit Prote in (g/ unit) Vitamin C (mg/ unit) Iron (mg/ unit) Cost (ce nts/ unit)
Apples 1 med. 0.4 6 0.5 8
Bananas 1 med. 1.2 10 0.6 10

Minimal Daily Diet Requirement 70 50 12

Consumption
Apples x1 0
Bananas x2 58.33333333

Minimal cost 583.3333333

Constraint LHS RHS


Protein 70 >= 70
Vitamin C 583.3333333 >= 50
Iron 35 >= 12
x1 0 >= 0
x2 58.33333333 >= 0

So, to minimize cost while still address Minimal Daily Diet Requirement, the person has to eat
59* bananas per day. Minimal cost is about 590 cents
*Result was round up

You might also like