You are on page 1of 15

lOMoARcPSD|24851584

STK310Exam Section A 2018

Statistics (University of Pretoria)

Studocu is not sponsored or endorsed by any college or university


Downloaded by Gabriella Gricia (gabithepora@gmail.com)
lOMoARcPSD|24851584

Copyright reserved

UNIVERSITY OF PRETORIA
DEPARTMENT OF STATISTICS

ÿatiÿics 310
ÿk310
EXAMINATION 3 SECTION A JUNE 2018
EXTERNAL EXAMINER: DR S BIERMAN
INTERNAL EXAMINERS: DR PJ VAN STADEN & DR L FLETCHER

INITIALS & SURNAME

STUDENT NUMBER

SIGNATURE

o The question paper for Section A consists of 14 pages including this front page.
o Answer all questions in the spaces provided.
o An appendix containing a list of formulae is provided on page 14.
o No question paper may be taken out of the venue and no pages may be removed from the
question paper.
o Electronic resources such as smart phones, tablets and other mobile devices may not be used and
must be switched off.
o Use the correct notation and/or formulae and show all your calculations and derivations in order
to receive all marks.
o Unless stated otherwise, when performing a hypothesis test,
º specify the null and alternative hypotheses in terms of the relevant parameter(s),
º use a 5% significance level,
º write down the confidence interval or the p-value given in the SAS Output,
º indicate, with appropriate explanation, whether the null hypothesis is rejected or not,
º and provide a clear, concise conclusion.
o When using or giving values from the SAS Output, do not round off these values, but use or
give them exactly as they appear in the SAS Output.
o Unless stated otherwise, give final answers correctly up to 4 decimal places.
o All other test / examination regulations apply – see page 2.

MARK GIVEN (OUT OF 40):

Downloaded by Gabriella Gricia (gabithepora@gmail.com)


lOMoARcPSD|24851584

ÿk310 EXAM 3 SECTION A: JUNE 2018 2

TEST & EXAMINATION INSTRUCTIONS


1. Students are obliged to identify themselves positively by means of a valid student card when writing a test or examination. No
access to the test or examination venue will be allowed without a valid student card.
2. No person may pretend to be a registered student and/or write a test or examination on behalf of a student.
3. No student may enter the test or examination venue later than half an hour after commencement of a test or examination session.
No student may leave the test or examination venue earlier than half an hour after commencement of a test or examination
session. In the case of computer-based assessment, a student may not enter the venue after the punctual commencement of the
test or examination session.
4. Students must obey all the instructions given by an invigilator immediately and strictly.
5. Except as indicated in paragraph 6, students may not bring into the test or examination venue or have in their possession any of
the following:
o bags (satchels)
o handbags
o pencil cases or bags
o unauthorised apparatus
o books
o electronic means of communication or similar devices
o cellular phone watches (smart watches) or cellular phones (cellular phones may not be used as a substitute for calculators)
o any piece of paper, no matter how small
o notes of any nature whatsoever.
Mere possession of any of the aforementioned, irrespective of whether the student acted intentionally or negligently or innocently,
is regarded as a serious transgression of the rules and subsequently as serious academic misconduct. It remains the student’s
responsibility to verify, prior to the commencement of a test or examination, that none of the aforementioned items are in his or her
possession.
6. Satchels (book bags) and handbags may be kept with a student, provided that such bags are closed and placed under the
student’s chair. All books and study material must be stowed away in the closed bag. The student may not open or handle such
bag at all during the test or examination session. If study material and/or notes (belonging to a student), are found under the seat
or desk, or are visible to the student to such an extent that they could possibly assist the student, such student shall be regarded
as being in possession of prohibited, unauthorised material. Electronic devices such as cell phones and tablets must be switched
off and placed inside the bag, which is to be closed and to be kept under the student’s chair. In the absence of a bag a student
must switch off his or her cell phone or tablet or any other device and place it on the floor under his/her chair and out of the
student’s line of sight. These devices may not be kept on the person of the student and may not be switched on or handled by the
student during the test or examination session.
7. Students are responsible for providing their own writing materials, apparatus and stationery in accordance with the requirements
and specifications or instructions set by the lecturer concerned. Mutual exchange of such items will not be allowed.
8. Wearing of caps, hats or beanies during examinations and tests is prohibited and students may be requested to remove such
headgear. An exception is made in the case of religious headgear.
9. It is important that the surname, full names and signature of the student are provided in the relevant space on the test or
examination answer script. If so preferred by the student, this information may be treated as confidential by folding and sealing the
top portion of the examination or test answer script. The covered portion may only be opened by the examiner if the student
number is incorrect or illegible. All scripts must be completed in indelible ink. Scripts completed in pencil or erasable ink will not be
marked and the writer (student) will not qualify for an additional evaluation opportunity (test/examination).
10. Once the invigilator has announced the commencement of the test or examination, all conversation or any other form of
communication between students must cease. During the course of the test or examination no communication of any nature
whatsoever may take place between students.
11. No student may assist or attempt to assist another student, or obtain help, or attempt to obtain help from another student during a
test or examination.
12. Students may not act dishonestly in any way whatsoever. Dishonest conduct includes, but is not limited to:
o dishonesty with regard to any assessment, whether it be a test or an examination, or with regard to the completion and/or
submission of any other academic task or assignment;
o plagiarism (using the work of others as though it is your own without acknowledging the source);
o the submission of work by a student with a view to assessment when the work in question is that of someone else either in full
or in part, or where it is the result of collusion between the student and another person or persons. The exception is group
work as determined by the lecturer concerned.
13. Writing on any paper other than that provided for test or examination purposes is strictly prohibited. Students may also not write on
the test or examination paper, except in the case of fill-in and multiple-choice question papers.
14. Rough work should be done in the test or examination answer script and then crossed out. No pages may be removed from the test
or examination answer script.
15. Smoking is not permitted in the test or examination venue, and students will also not be permitted to leave the venue during the
test or examination for this purpose.
16. Only in exceptional circumstances will a student be given permission to leave the test or examination venue temporarily, and then
only under the supervision of an invigilator.
17. Students may not take used or unused answer scripts from the test or examination venue.
18. As soon as the invigilator announces during a test or examination that the time has expired, students should stop writing
immediately. In the case of computer-based assessment students are automatically stopped from working on the computer when
the login time expires.
19. Students may bring their own watches to the test/examination venue, but smart watches will not be allowed.

Students should take note that, if found guilty of academic misconduct or non-compliance with these rules, a student could,
among other penalties, forfeit his/her credits for a module and/or be suspended from the University for a period that could
range from one year to permanent suspension. Such a student’s record will be blocked for the period of suspension and
he/she will not be entitled to a certificate of good conduct from the University during this period. Students should also take
note that, if found guilty of academic misconduct, it may negatively influence their admission to other universities and/or
registration with professional councils. Academic misconduct is indicated on all certificates of conduct provided to students
by the University.

Downloaded by Gabriella Gricia (gabithepora@gmail.com)


lOMoARcPSD|24851584

ÿk310 EXAM 3 SECTION A: JUNE 2018 3

QUESTION 1 (11 MARKS)


Consider the k-variable population regression function (PRF) model,

Yi = β1 + β 2 X 2i + β 3 X 3i + ... + β k X ki + ui , i = 1, 2, ..., n ,

where

o Yi is the dependent variable,


o X 2i , X 3i , ..., X ki are the k − 1 explanatory variables,
o β1 is the intercept term,
o β 2 , β3 , ..., β k are the k − 1 partial slope coefficients,
o and ui is the stochastic error term.

The matrix representation of the PRF model is given by

y = X³ + u ,

where

o y is a n × 1 column vector of n observations on the dependent variable,


o X is a n × k data matrix with the first column of 1’s representing the intercept term and the
next k − 1 columns consisting of n observations on the k − 1 explanatory variables,
o ³ is a k × 1 column vector of the unknown intercept and slope parameters,
o and u ~ N (0, σ 2 I) is a n × 1 column vector of the n error terms, assumed to have a multivariate
normal distribution.

The corresponding sample regression function (SRF) is given by

Yi = βˆ1 + βˆ2 X 2i + βˆ3 X 3i + ... + βˆk X ki + uˆi , i = 1, 2, ..., n ,

or in matrix notation by

y = X³ˆ + uˆ ,

with

o ³̂ a k × 1 column vector of the ordinary least squares (OLS) estimators of ³ ,


o and û a n × 1 column vector of n residuals.

Downloaded by Gabriella Gricia (gabithepora@gmail.com)


lOMoARcPSD|24851584

ÿk310 EXAM 3 SECTION A: JUNE 2018 4

(a) Show that the OLS estimator for ³ is ³ˆ = ( X ' X ) −1 X ' y .

(4)

Downloaded by Gabriella Gricia (gabithepora@gmail.com)


lOMoARcPSD|24851584

ÿk310 EXAM 3 SECTION A: JUNE 2018 5

(b) Show that the OLS estimator for ³ can be rewritten as ³ˆ = ³ + ( X ' X ) −1 X ' u .

(2)

(c) Show that E (³ˆ ) = ³ .

(2)

Downloaded by Gabriella Gricia (gabithepora@gmail.com)


lOMoARcPSD|24851584

ÿk310 EXAM 3 SECTION A: JUNE 2018 6

(d) Show that the variance-covariance matrix of ³̂ is var - cov(³ˆ ) = σ 2 ( X ' X ) −1 .

(3)
[11]

Downloaded by Gabriella Gricia (gabithepora@gmail.com)


lOMoARcPSD|24851584

ÿk310 EXAM 3 SECTION A: JUNE 2018 7

QUESTION 2 (16 MARKS)


The relation between maximal running speed (MRS) and body mass in terrestrial mammals can be
modelled with the allometric equation

Y = β1 X β 2 ,

where Y is the MRS in kilometers per hour (km/h) and X is the body mass in kilograms (kg).

Consider a data set with 15 South African mammals selected from the updated Super Animal cards. z
This data set is given in the file “mammals.txt” with the values of Y in the second column and the
values of X in the third column.

Note that the dummy variable D in the fourth column of the file will only be used in Question 2(e).

Applying a double-log transformation to the allometric equation yields a linear regression model,

Y * = α + β2 X * + u ,

with Y * = ln Y , α = ln β1 and X * = ln X , and where u is the stochastic error term.

Use proc reg in SAS to fit this linear regression model to the data with the method of OLS.

Include appropriate options in the model statement of proc reg to obtain 95% confidence
intervals for α and β 2 as well as 95% confidence intervals for the individual MRS values.

(a) Complete the SAS program below:

data loglog;
set mammals;
lny = ___________________;
lnx = ___________________;
run;
proc reg data = loglog plot = none;
model _____________________________________________;
id mammal;
run;
(4)

z www.campaigns.pnp.co.za/superanimals/

Downloaded by Gabriella Gricia (gabithepora@gmail.com)


lOMoARcPSD|24851584

ÿk310 EXAM 3 SECTION A: JUNE 2018 8

(b) Give the estimated regression coefficients:

α̂

βˆ2

(2)

(c) Calculate a 95% confidence interval for the suricate’s MRS.

(2)

Downloaded by Gabriella Gricia (gabithepora@gmail.com)


lOMoARcPSD|24851584

ÿk310 EXAM 3 SECTION A: JUNE 2018 9

(d) Use a 95% confidence interval to test whether the mean MRS will increase by 0.2% if the body
mass increases by 1%.

For the hypothesis test you must

o specify the null and alternative hypotheses in terms of the relevant parameter(s),
o write down the 95% confidence interval given in the SAS Output,
o indicate, with appropriate explanation, whether the null hypothesis is rejected or not,
o and provide a clear, concise conclusion.

(4)

Downloaded by Gabriella Gricia (gabithepora@gmail.com)


lOMoARcPSD|24851584

ÿk310 EXAM 3 SECTION A: JUNE 2018 10

(e) Consider the linear regression model

Y * = α + β 2 X * + β 3D + u

with Y * = ln Y , α = ln β1 , X * = ln X and where D = 0 for ungulates and D = 1 for carnivores.

Use proc reg in SAS to fit this linear regression model to the data with the method of OLS.

Determine whether there is a significant difference between the mean MRS of ungulates and
carnivores using an appropriate t-test.

For the t-test you must

o specify the null and alternative hypotheses in terms of the relevant parameter(s),
o write down the p-value given in the SAS Output,
o indicate, with appropriate explanation, whether the null hypothesis is rejected or not,
o and provide a clear, concise conclusion.

(4)
[16]

Downloaded by Gabriella Gricia (gabithepora@gmail.com)


lOMoARcPSD|24851584

ÿk310 EXAM 3 SECTION A: JUNE 2018 11

QUESTION 3 (13 MARKS)


Milner & Rougier (2014) discussed the weighing of donkeys in Kenya using a nomogram. l
In this case study measurements for 541 donkeys were collected on the following variables:

o Y : weight in kilograms (kg)


o X 2 : girth in centimeters (cm)
o X 3 : height in centimeters (cm)
o X 4 : length in centimeters (cm)

The data set is given in the file “donkeys.txt” with the values of Y in the first column, the values of
X 2 in the second column, the values of X 3 in the third column and the values of X 4 in the fourth
column.

(a) Consider only the weight ( Y ), girth ( X 2 ) and height ( X 3 ).

Use proc corr in SAS to calculate the partial correlation coefficient between weight and
girth.

i. Complete the SAS program below:

proc corr data = donkeys;


var _____________________;
partial _________________;
run;
(2)

ii. Give and interpret the partial correlation coefficient between weight and girth.

(3)

l Milner, K. & Rougier, J. 2014. How to weigh a donkey in the Kenyan countryside. Significance, 11(4), 40-43.

Downloaded by Gabriella Gricia (gabithepora@gmail.com)


lOMoARcPSD|24851584

ÿk310 EXAM 3 SECTION A: JUNE 2018 12

(b) Consider the linear regression model

Y = β1 + β2 X 2 + β3 X 3 + β 4 X 4 + u .

Use proc reg in SAS to fit this linear regression model to the data with the method of OLS.

Include a test statement in proc reg to obtain an F-test to determine whether the mean
weight of a donkey will increase by 2.5kg if there is a 1cm increase in the girth of the donkey
while its height and length remain unchanged.

i. Complete the SAS program below:

proc reg data = donkeys plot = none;


model ____________________;
test _____________________;
run;
(2)

Do the F-test by

o specifying the null and alternative hypotheses in terms of the relevant parameter(s),
o writing down the p-value given in the SAS Output,
o indicating, with appropriate explanation, whether the null hypothesis is rejected or not,
o and providing a clear, concise conclusion.

(4)

Downloaded by Gabriella Gricia (gabithepora@gmail.com)


lOMoARcPSD|24851584

ÿk310 EXAM 3 SECTION A: JUNE 2018 13

(c) Considering all three available explanatory variables, use proc reg in SAS to find the best
possible three-variable linear regression model based upon the adjusted coefficient of
determination.

That is, find the best linear regression model using two out of the three available explanatory
variables to explain weight.

Do not apply any transformations to any of the variables.

Give the two selected explanatory variables and the corresponding value of the adjusted
coefficient of determination:

Explanatory variables in model

Adjusted coefficient of determination

(2)
[13]
TOTAL MARKS: 40

Downloaded by Gabriella Gricia (gabithepora@gmail.com)


lOMoARcPSD|24851584

ÿk310 EXAM 3 SECTION A: JUNE 2018 14

APPENDIX: FORMULAE

û ( x − µ )2 þ
( )
If X ~ N µ , σ 2 , then f X ( x ) =
1
expüü −
2σ 2 øÿ
ÿ
2πσ 2 ý

n 3 X iYi − 3 X i 3Yi 3 ( X i − X )(Yi − Y ) = 3 xi yi = 3 xiYi


βˆ1 = Y − βˆ2 X βˆ2 = =
n3 X i2 − (3 X i )
2
3 ( X i − X )2 3 xi2 3 xi2
σ 3 Xi 2 2
σ2
( )
var βˆ1 = ( )
var βˆ2 =
n 3 xi2 3 xi2

( )
cov βˆ1 , βˆ2 = − X var βˆ2 ( ) σ̂ 2 = 3 uˆi2
n−k

n 3 X iYi − 3 X i 3Yi 3 xi yi
r= =
(n3 X i
2
− (3 X i )
2
) (n3Y i
2
− (3Yi )
2
) 3 xi2 3 yi2

3 (Yˆi − Y ) = 1 − 3 uˆi2 3 uˆi2 (n − k ) = 1 − (1 − R 2 )ûü n − 1 þÿ


2

R 2
= R2 =1−
3 (Yi − Y )
2
3 yi2 3 yi2 (n − 1) ýn−kø

βˆ j − β j
t= ~ t (n − k ) for j = 1, 2, ..., k βˆ j ± tα 2 ( )
var βˆ j for j = 1, 2, ..., k
( )
var βˆ j

σˆ 2 û 2 2 þ
W = (n − k ) ~ χ 2 (n − k ) ü (n − k ) σˆ , ( n − k ) σˆ ÿ
σ 2 ü χα2 2 χ12−α ÿ
ý 2ø

ESS ( k − 1) R 2 ( k − 1)
F= = ~ F (k − 1 , n − k )
RSS (n − k ) (1 − R 2 ) ( n − k )

2
( RSSR − RSSUR ) m ( RUR − RR2 ) m
F= = 2
~ F (m , n − k )
RSSUR (n − k ) (1 − RUR ) (n − k )

û 1 ( X − X )2 þ
( )
var Yˆ0 = σ 2 ü + 0 2 ÿ
ün
Yˆ0 ± tα ( )
var Yˆ0
3 xi øÿ
2
ý

û 1 ( X − X )2 þ
( )
var Y0 − Yˆ0 = σ 2 ü1 + + 0 2 ÿ
ü n
Yˆ0 ± tα (
var Y0 − Yˆ0 )
3 xi øÿ
2
ý

Downloaded by Gabriella Gricia (gabithepora@gmail.com)

You might also like