ECON20003 S1 2024 Sample Exam Solutions

Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

ECON20003 Quantitative Methods 2

Final Exam Solutions

1. A marketing research student conducted a study on the impact of packaging on


consumer satisfaction. The student randomly selected two separate groups of 100
individuals and provided them with a free sample of cereal. The groups were
distinguished by the type of packaging used (packaging type 1 = box, packaging type 0
= bag), and their satisfaction level with the product was recorded on a scale of 1 to 100.

The student analyzed the data to determine if there is a difference in satisfaction levels
between consumers based on the type of packaging. The analysis produced several R
printouts, which are presented below. Use a 1% level of significance throughout this
question.

(4 + 6 + 4 + 2 + 5 = 21 marks)
The R output of histograms for Satisfaction by Type of Packaging
Distributions of Satisfaction Levels for Distributions of Satisfaction Levels for
Box Packaging Bag Packaging

The R output of descriptive statistics for Satisfaction by Type of Packaging

Satisfaction_Bag Satisfaction_Box
median 80.000 70.000
mean 79.490 71.160
SE.mean 1.021 0.952
CI.mean.0.95 2.026 1.889
var 104.293 90.600
std.dev 10.212 9.518
coef.var 0.128 0.134
skewness -0.168 0.328
skew.2SE -0.347 0.680
kurtosis -0.516 -0.554
kurt.2SE -0.539 -0.580
normtest.W 0.989 0.976
normtest.p 0.563 0.061

1
R output for various tests on the variable Satisfaction by Type of Packaging

F test to compare two variances

data: satisfaction_bag and satisfaction_box


F = 0.86871, num df = 99, denom df = 99,
alternative hypothesis: true ratio of variances is not equal to 1
sample estimates:
ratio of variances
0.8687117

Two Sample t-test

data: satisfaction_bag and satisfaction_box


t = -5.9669, df = 198, p-value = 1.098e-08
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-11.083019 -5.576981
sample estimates:
mean of x mean of y
71.16 79.49

Welch Two Sample t-test

data: satisfaction_bag and satisfaction_box


t = -5.9669, df = 197.03, p-value = 1.105e-08
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-11.083102 -5.576898
sample estimates:
mean of x mean of y
71.16 79.49

Wilcoxon signed rank test with continuity correction


data: satisfaction_bag and satisfaction_box
V = 986.5, p-value = 3.42e-07
alternative hypothesis: true location shift is not equal to 0

2
(a) Briefly explain the aims of the tests shown on the last four printouts. What do they
test and what do they assume about the underlying populations?
(4 marks)

F-test to compare two variances.

Explanation:

Is a test for the null hypothesis that two normal populations have the same
variance.

Independent samples t-test (two sample t-test on the printout) aims to verify
some statement about the difference between two population means.

Explanation:

Based on two independent random samples drawn from the two normal
populations.

Welch's t-test also known as unequal variances t-test. Is used when you
want to test whether the means of two normal populations are equal.

Explanation:

This test is generally applied when the there is a difference between the variances
of two normal populations.

The Wilcoxon signed rank test is a nonparametric alternative to the paired


sample t-test. It is also based on a random sample of paired observations.

Explanation:

but it compares the medians rather than the means and assumes that both
independent populations have the same ‘shape’ (under the alternative their
distributions are the same except for a shift in the median).

3
(b) Looking at the “F test to compare two variances” printout, test at the
1% significance level whether the population variance of the level of satisfaction for
cereal in a box differs from the population variance of the satisfaction of cereal in a
bag. Answer by stating the null and alternative hypotheses; providing an appropriate
test statistic and its distribution and describing an appropriate decision rule. You may
use the test statistic provided in the printout. (6 marks)

Answer:

Step 1: Are the two population variances equal?


𝐻0 : 𝜎12 ⁄𝜎22 = 1 𝑜𝑟 𝜎12 = 𝜎22
𝜎12
𝐻𝐴 : 2 ≠ 1 𝑜𝑟 𝜎12 ≠ 𝜎22
𝜎2

Step 2: Given the two populations are normally distributed, we use:


𝑠12 ⁄𝜎12 𝑠12
𝐹 = 2 2 = 2 ~𝐹𝛼,(𝑛1 −1,𝑛2 −1)
𝑠2 ⁄𝜎2 𝑠2

Step 3: Significance level of 𝛼 = 0.01

Step 4: Reject 𝐻0 if 𝐹 < 𝐹0.005,(100−1,100−1) ≈ 0.595 or if


𝐹 > 𝐹0.995,(100−1,100−1) ≈1.68

Step 5: Test statistic is


90.600
𝐹 = 104.293 = 0.86871 (or from output)

Step 6: 𝟎. 𝟓𝟗𝟓 < 0.86871 < 1.68 DO NOT Reject 𝐻0 ,


conclude population variances are equal at the
1% level of significance.

4
(c) Given the research question, the variable of interest and the data, which test
provided in the last three printouts is most appropriate this time? Explain why it is
appropriate and the others are not. What are the null and alternative hypotheses of
your chosen test in the context of this study?
(4 marks)

Answer:

The independent sample t-test appears appropriate this time.

Explanation: Award 2 marks if at least 3 points were listed, otherwise,

1. The variable of interest is the satisfaction level of individuals and


whether there is a difference between the Box and Bag groups.
2. The two samples of 100-100 individuals are independent of each other.
Hence the Wilcoxon signed rank test is inappropriate.
3. Descriptive statistics reveal that both groups are normally distributed
(skew.2E and kurt.2SE less than |1| and/or norm test p>0.01). So, either
the Two Sample t-test or Welch Two Sample t-test may be appropriate.
4. However, part (b) reveals that variances are equal; hence a Welch Two-
Sample test is unnecessary.

The hypothesis for the independent sample t-test is:


𝑯𝟎 : 𝝁𝒃𝒂𝒈 = 𝝁𝒃𝒐𝒙
𝑯𝑨 : 𝝁𝒃𝒂𝒈  𝝁𝒃𝒐𝒙
Deduct 1 mark if the test is not a two-tail

5
(d) Evaluate the printout of the test you chose in part (c) at the 1% significance level to
decide whether there is a difference in the satisfaction levels of cereal sold in a box
and in a bag. Specify the p-value, make a statistical decision, and draw your
conclusion. (2 marks)

Answer:

P-value:
The p-value of the Two-sample t-test is 1.098e-08

Statistical decision
Since the p-value <0.01, therefore, at the 1% significance level we REJECT the
null hypothesis.

Conclusion.
It is possible to conclude that the mean difference in satisfaction is different
across consumers who receive the two different package types.

6
(e) What assumptions about the population data are required to validate the test you
performed in part (d)? Use as much information as possible to find out whether these
conditions are likely satisfied this time. Briefly explain your answer.
(5 marks)

First requirement:

Two independent random samples of independent observations.

Explanation:

“The student randomly selected two separate groups of 100 individuals” implying also
that the samples are independent.

Second requirement:

Continuous variable, measured on an interval or ratio scale.

Explanation:

The variable of interest, the satisfaction level, is a quantitative variable measured on


an interval scale.

Third requirement:

The sampled populations are normally distributed, at least approximately.

Explanation:

We can check normality using the histograms, the reported descriptive statistics,
and the Shapiro-Wilk tests.

For Bag and Box alike,

The histogram is symmetric, the histograms suggest that the two sampled
populations are unimodal and have similar shapes.

The sample mean and median are similar, skew.2SE and kurt.2SE are less than
|1|,

The SW tests statistic is insignificant at any reasonable significance level.

Hence, both populations are most likely normal.

7
3. A researcher wishes to explore factors that are associated with life expectancy
across different countries to help identify potential disparities in health outcomes
across different regions and provide a basis for developing policies aimed at reducing
these disparities.
To this end, for a sample of 180 countries, they regress the variable Life_expectancyi
(Life expectancy at birth, total years) against the following explanatory variables:

• Health_expenditure_PCi: Current health expenditure per capita,(current


international $,000s)
• GDP_PCi: GDP per capita, PPP (current international $,000s)
• UHCi: Universal Health Care service coverage (Binary 1: Greater than or
equal to 80%; 0: Less than 80%)
• Urban_popi: Urban population (% of total population)
Use a level of significance of 1%. You may use p-values where available to asses
hypothesis tests.

The R output from this OLS regression as follows:


> #model <- lm(Life_expectancy ~ GDP_PC + UHC_coverage +
Unemployment + Urban_pop, data = data)
>
> # print the summary of the model
> summary(model)

Call:
lm(formula = Life_expectancy ~ Health_expenditure_PC + GDP_PC +
UHC + Urban_pop, data = data)

Residuals:
Min 1Q Median 3Q Max
-15.6898 -2.4945 0.7976 3.5943 9.7819

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 63.34741 1.05252 60.187 < 2e-16 ***
Health_expenditure_PC 0.29979 0.41207 0.728 0.4679
GDP_PC 0.13900 0.03342 4.160 4.99e-05 ***
UHC 2.51961 1.50867 1.670 0.0967 .
Urban_pop 0.08735 0.02103 4.153 5.11e-05 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 4.675 on 175 degrees of freedom


Multiple R-squared: 0.6151, Adjusted R-squared: 0.6063
F-statistic: 69.93 on 4 and 175 DF, p-value: < 2.2e-16

11
The R output of QQ Plot, Histogram, Descriptive Statistics of model residuals and Residuals
vs. Predicted Values:

Normal Q-Q Plot of Residuals Histogram of Residuals


10

20
5
Sample Quantiles

Frequency

15
0
-5

10
-10

5
-15

0
-2 -1 0 1 2 -15 -10 -5 0 5 10

Theoretical Quantiles Residuals

Residuals vs. Predicted Values


res
median 0.798
10

mean 1.72E-16
SE.mean 0.345
5

CI.mean.0.95 0.680
var 21.371
Residuals

std.dev 4.623
coef.var 2.69E+16
-5

skewness -0.739
skew.2SE -2.040
-10

kurtosis 0.170
kurt.2SE 0.235
-15

normtest.W 0.951
normtest.p 6.89E-06
65 70 75 80 85 90

Predicted Values for Life Expectancy

The R output of the White test (studentized Breusch-Pagan test) for homoskedasticity:
studentized Breusch-Pagan test

data: model
BP = 7.344, df = 4, p-value = 0.1188

The R output of the correlation matrix of the independent variables:


> # print the correlation matrix
> print(corr_matrix <- cor(data[, 2:ncol(data)]))
Health_expenditure_PC GDP_PC Urban_pop UHC
Health_expenditure_PC 1.0000000 0.8595555 0.5962627 0.8014060
GDP_PC 0.8595555 1.0000000 0.6687418 0.6724607
Urban_pop 0.5962627 0.6687418 1.0000000 0.4540374
UHC 0.8014060 0.6724607 0.4540374 1.0000000

12
The R output of the Variance Inflation Factor:
> # calculate the VIF for each independent variable
> vif(model)
Health_expenditure_PC GDP_PC UHC Urban_pop
5.904326 4.484705 2.806123 1.816616

The R output of the descriptive statistics of the model variables:


Life_expectancy Health_expenditure_PC GDP_PC Urban_pop UHC
median 73.52 0.83 14.73 59.46 0.00
mean 72.51 1.65 22.03 58.94 0.18
SE.mean 0.56 0.15 1.65 1.67 0.03
CI.mean.0.95 1.10 0.30 3.26 3.29 0.06
var 55.53 4.25 490.49 501.64 0.15
std.dev 7.45 2.06 22.15 22.40 0.39
coef.var 0.10 1.25 1.01 0.38 2.12
skewness -0.44 1.94 1.56 -0.18 1.62
skew.2SE -1.22 5.35 4.30 -0.50 4.48
kurtosis -0.65 3.87 2.59 -0.99 0.64
kurt.2SE -0.90 5.36 3.59 -1.37 0.89
normtest.W 0.96 0.75 0.83 0.97 0.47
normtest.p 0.00 0.00 0.00 0.00 0.00

The R output of the Ramsey Regression Equation Specification Error Test (RESET) of the
model:
> # run a RESET test on the model
> resettest(model)

RESET test

data: model
RESET = 31.786, df1 = 2, df2 = 173, p-value = 1.751e-12

The R output of a linear hypothesis test:


> linearHypothesis(model, c("Health_expenditure_PC = 0"))
Linear hypothesis test

Hypothesis:
Health_expenditure_PC = 0

Model 1: restricted model


Model 2: Life_expectancy ~ Health_expenditure_PC + GDP_PC + UHC +
Urban_pop

Res.Df RSS Df Sum of Sq F Pr(>F)


1 176 3837.0
2 175 3825.4 1 11.57 0.5293 0.4679

13
(a) What does the estimated dependent variable measure? Given the dependent variable,
what type of regression model has been estimated? (2 marks)

What does the estimated dependent variable measure?

The dependent variable is a numerical continuous measure of Life Expectancy in Years.

Type of regression model:

The estimated regression model is a multiple linear regression using OLS estimation.

(b) Test the overall significance of the model at the 1% significance level. What are the
hypotheses, the statistical decision and the conclusion? (4 marks)

Null and alternative hypotheses:


𝐻0 : 𝛽1 = 𝛽2 = 𝛽3 = 𝛽4 = 0
𝐻𝐴 : 𝐴𝑡 𝑙𝑒𝑎𝑠𝑡 𝑜𝑛𝑒 𝛽𝑗  0

p-value and decision:

p-value for the test of overall utility of the model is 2.2e-16 < 0.01. Hence reject the
null hypothesis.

Conclusion:

Some sensible interpretation: e.g. At the 1% level of significant we conclude:

▪ The model coefficients are collectively significant.

▪ The model is better than predicting Life Expectancy than one that assumes no
relationship between Life Expectancy and the explanatory variables.

▪ The regression model performs better at predicting Life expectancy than the
sample mean.

14
(c) Test appropriate hypotheses concerning the two-sided significance of the slope
coefficients using t-tests at the 1% significance level. What are the hypotheses and
what do you conclude? (3 marks)

Null and alternative hypotheses:

For each j=1,2,3


𝐻0 : 𝛽j = 0

𝐻𝐴 : 𝛽𝑗  0

p-value and decision:

The p-value of each coefficient can be assessed against alpha = 0.01

p-value<0.01: Reject the null hypothesis that 𝐻0 : 𝛽j = 0

Conclusion:

As a result; GDP Per Capita and Proportion of Urban Population appear to be


significant predictors of Life Expectancy.

(d) Carefully explain the meanings of the slope coefficients that you deemed significant
at the 1% level. (4
marks)

GDP_PCi:

For every $1000 increase is GDP per capita (current international $s) Life Expectancy
increases by 0.139 years on average holding other variables constant.
Award 1 mark only if does not mention the impact on the Life Expectancy.

Urban_popi:

For every 1 percentage point increase in Urban Population; Life Expectancy increases
by 0.087 years on average holding other variables constant.
Award 1 mark only if does not mention the impact on the Life Expectancy.

15
(e) Interpret the coefficient of determination. Is the model likely to be useful in
predicting Life Expectancy? Explain your answer. (2 marks)

Interpreting the coefficient of determination:

The adjusted R2 is about 0.61, so about 61% of the total sample variation in Life
Expectancy can be accounted for by the model.

Is the model useful?

The model has a “reasonably good” fit and is likely useful in predicting life
expectancy.

(f) Does the normality assumption seem to be satisfied? Why or why not? Use as much
information from the R printouts as you can and be specific. (3
marks)

Does the normality assumption seem to be satisfied?

The normality requirement is likely not satisfied and statistical inference from the F-and
t-tests are invalid.

Reasons:

• The histogram is left-skewed and on the QQ plot the points are deviated
from the straight line.

• The residuals’ median deviates from the mean and the absolute values of
skew.2SE is smaller than one.

• The p-value of the Shapiro-Wilk test is less than 0.01.

Award 2 marks for listing at least two of the reasons above.

Based on the errata sheet - Check the solution and the rubric

16
(g) Comment of the “OLS residuals versus price_hat” ‘Life_expectancy_hat” scatterplot
and on the “studentized Breusch-Pagan test” printout. What do they suggest to you
about the estimated regression model?
(4 marks)

a. On the scatterplot of res against price_hat, there is a clear “funnel pattern” with
decreasing variance indicating heteroskedasticity.

b. The p-value of the Breusch-Pagan test is 0.1188, so we maintain the null


hypothesis of homoskedasticity, which is in contradiction to the scatterplot.

c. The homoskedasticity assumption may not be satisfied. If so while coefficient


estimate are unbiased, standard errors are not. Caution ought to be exercised in
interpreting t and F-scores and confidence intervals

(h) Determine whether imperfect multicollinearity is a concern in the given model? Please
provide as much evidence as possible to support your conclusion. If multicollinearity is
a concern, propose a solution to address the problem. (5 marks)

Multicollinearity may be a significant concern for the following reasons: (3 marks)

• While signs are as expected, two explanatory variables (GDP Per Capita
and Universal healthcare Coverage) that we expect to be statistically
significantly associated with Life Expectancy appear not to be
(comparatively large standard errors for coefficient estimates)

• Bivariate linear correlation is fairly high (over 0.80) between Health


Expenditure PC and GDP PC as well as between Health Expenditure PC
and Universal Healthcare Coverage.

• Variance Inflation Factor is higher than the rule of thumb value of 5 for
Health Expenditure PC and high (4.46) for GDP Per Capita.

Solutions may include:


(2 marks)

• Dropping one or two if the suspected multicollinear variables such as


Health Expenditure, GDP Per Capita or UHC

• Replace the multicollinear variables with their combination or with some


transformed variables.

• Increasing sample size (would shrink s.e.’s though limited use given upper
limit to number of countries in world)

(2 + 4 + 3+ 4 + 2 + 3 + 4 + 5 = 27 marks)

17
4. A commodities researcher considers monthly data on the world prices of Corn (Corn)
and Soybeans (Soy), both measured in US$ dollars per metric ton, from Jan. 2018 to
Mar. 2023. Both soybeans and canola are used in the production of vegetable oil and
are widely traded internationally. As a result, their prices are often closely linked and
may be considered substitutes for each other in certain contexts. For these reasons,
their prices are likely interrelated in the sense that price movements on the Corn market
are probably affected, among others, by economic developments in the world Soybean
market.

To this end she specifies the following population model:

log(Corn)t=β0+β1log(Corn)t−1+ β2log(Soy)t+ϵt

where,

Corn represents average of Soybeans,US$ per metric ton


Soy represents average price of Corn, US$ per metric ton
t represents the time period
log() denotes the natural logarithm function
ϵt represents the error term at time t.

The R output from this OLS regression as follows:


> ar_model <- lm(logCorn ~ lag(logCorn, 1) + lag(logSoy,0), data =
data)
> summary(ar_model)

Call:
lm(formula = logCorn ~ lag(logCorn, 1) + lag(logSoy, 0), data =
data)

Residuals:
Min 1Q Median 3Q Max
-0.073996 -0.029353 -0.005261 0.026902 0.152338

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.69120 0.16629 -4.157 0.000106 ***
lag(logCorn, 1) 0.59969 0.05995 10.004 2.54e-14 ***
lag(logSoy, 0) 0.47137 0.07013 6.721 8.01e-09 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.04765 on 59 degrees of freedom


(1 observation deleted due to missingness)
Multiple R-squared: 0.974, Adjusted R-squared: 0.9731
F-statistic: 1104 on 2 and 59 DF, p-value: < 2.2e-16

18
0.05 0.10 0.15
OLS residuals Residuals vs Lagged Residuals

0.05 0.10 0.15


Residuals

e(t)
-0.05

-0.05
0 10 20 30 40 50 60 -0.05 0.00 0.05 0.10 0.15

Time e(t-1)

The R output for Durbin Watson D test


> dwtest(ar_model)
Durbin-Watson test
data: ar_model
DW = 1.3084, p-value = 0.001091
alternative hypothesis: true autocorrelation is greater than 0

The R output for Breusch-Godfrey LM test


> bgtest(ar_model, 2)
Breusch-Godfrey test for serial correlation of order up to 2
data: ar_model
LM test = 15.869, df = 2, p-value = 0.0003582

19
(a) Test appropriate hypotheses concerning overall model utility and the two-sided
significance of the slope coefficients using t-tests at the 1% significance level. You
may use p-values and summarize results. Overall, does the model have good ‘fit’.
Explain your conclusions? (4
marks)

F-test overall utility- p-value and decision:

F-statistic p-value<0.01, reject null that slope coefficients are zero, model has utility.

t-tests - p-value and decision:


The p-value of each coefficient can be assessed against alpha = 0.01
p-value<0.01: Reject the null hypothesis that 𝐻0 : 𝛽j = 0

Conclusion:
As a result; both the one month lagged value of the log of Corn Prices and log of Soy
Prices appear to be statistically significant predictors of current logged Corn prices.

Does the model have good ‘fit?


’The R2 for the model 0.974 and appears to do quite well in explaining the monthly
variation in Corn prices.

(b) Carefully explain the meanings of the slope coefficients that you deemed significant
at the 1% level. Explain if they make sense or not. (4 marks)

The slope estimates are all significant at the 1% level.

Explanations:

1. A one-percent increase in the price of Corn in the previous month is associated


with a 0.59 percent increase in the current price of corn, holding other variables
constant.
2. A one-percent increase in the current price of Soybeans is associated with a 0.47
percent increase in the current price of Corn, holding other variables constant.
3. Corn and Soybeans are said to be substitutes so is reasonable to expect a positive
relationship between percentage changes in prices.
4. How previous month’s price of Corn should relate to current prices is less clear,
but it may be reasonable to think the prices have inertia and that increases are
predictive of further increases.

20
(c) Determine whether autocorrelation is a concern in the given model? Explain what
autocorrelation is and provide as much evidence as possible to support your
conclusion and use a significant level of 1%. If autocorrelation is a concern, propose a
solution to address the problem.
(5 marks)

Explain what the autocorrelation is

Autocorrelation is the violation of TSLR4: “Conditional on the independent variables, the


random errors in any two different time periods are uncorrelated”.

Evidence to support your conclusion:

Since the population error term cannot be observed, we study the OLS residuals.

i. The plot of et against time (t) does not present a strong pattern for first
order serial correlation, though it does seem that there a few stretches of
errors with the same sign; indicative of potential first order positive serial
correlation.
ii. The plot of et against et-1 does not present a strong pattern across diagonal
quadrants though there are some more extreme values in the top right
quadrant and alongside a preponderance of observations along the bottom-
left and top-right quadrant; indicative of potential first order positive serial
correlation.
iii. The Durbin-Watson d -test rejects the null of no first order serial correlation
in the residuals. (p<0.01)
iv. The Breusch-Godfrey L rejects the null of no serial correlation up to order 2.

Autocorrelation does seem to be a concern in this model.


Propose solution:

Any one of the following solutions may be applicable:

• Use the heteroskedasticity and autocorrelation consistent (HAC) standard


errors of Newey and West.
• Estimate an appropriately transformed equation that has the original
parameters but independent errors such as through Generalized Least
Squares.

(4 + 4 + 5 = 11 13 marks)

21

You might also like