Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

STAT6083 Generalised Linear Models

Assignment

.  This assignment is worth 50% of the overall mark for STAT6083.

. The deadline for submission is 16.00 on Monday 4 December 2023.

.  Standard  University  policies  and procedures will be followed for late submission, extensions and academic integrity (see the Module Outline for details).

.  Submission is via Blackboard.

You should submit a report containing your answers in a ile called report-ID . pdf, where ID is your student ID number, for example

report-1234567. pdf. In the STAT6083 Assignments folder, click on

STAT6083 Assignment report submission to submit your report.  Please enter this ile name as the Submission Title.

You should not include  R code used in your analysis in your report, but you  must submit a separate  R  script via Blackboard containing your code called  code-ID .R, for example code-1234567.R. This code should reproduce the re-  sults contained in your report. Please rename and use the R template code-xxx. R provided. In the STAT6083 Assignments folder, click on

STAT6083 Assignment code submission and then Upload Files to submit your code.

.  The page limits given below for each task are strict and is easily su伍cient to receive full credit. Any pages beyond the limits will not be marked.

You are permitted, but not required, to use Generative Artiicial Intelligence (GenAI) for improving text that you have written yourself (e.g., for proofreading purposes).  You are not allowed to use it for the generation of content.  In any case, if you do use GenAI, you should include in your report an appendix of up to one page acknowledging how it was used.  This additional page will not count towards your page limit.  You should also bear in mind that GenAI may produce material that:

.  is considered as plagiarism, thus breaching academic integrity and incurring a penalty;

.  is factually incorrect, which would also be penalised.

As always, the onus is on you to ensure that there is no plagiarism and the material is factually correct in your report.

Task 1 [Total 65 marks, max. 9 pages]

A non-governmental agency wants to produce a preliminary report comparing the Mater- nal Mortality Ratio (MMR) across countries in the world.  The aim is to inform the public discussion about the monitoring of the relevant Sustainable Development Goals.  Under- standing the relationship between the MMR and other indicators such a Gross Domestic Product (GDP), Life Expectancy and Total Fertility Rate is a relevant issue.  Therefore, you are asked to formulate a linear regression model that helps to explain the relation- ship between MMR and these other variables. The dataset you have available (MMR.txt) contains data from 181 countries on the following variables:

country

Name of the country

mmr

Maternal Mortality Ratio, measured in deaths per 100 000 live births in a given year

gdp

Gross Domestic Product per capita, measured in US Dollars

tfr

Categorical variable indicating the level of Total Fertility Rate (TFR) 0: Low, 1: Medium, 2: High

lexpbw

Life expectancy at birth for women

1.  Produce and briely discuss appropriate tables or plots to assess the distribution of mmr and the relationship between mmr and gdp, tfr, and lexpbw. [10 marks]

2.  Use the appropriate function in R to it the following linear regression models:

M1:  A model for mmr with gdp as covariate

M2:  A model for mmr with gdp and gdp squared as covariates

M3:  A model for the natural logarithm of mmr with gdp as covariate

M4:  A model for the natural logarithm of mmr with the natural logarithm of gdp as covariate

(a)  Present a table with the itted coefficients and their estimated standard errors under models M1-M4. [4 marks]

(b)  Assess the model assumptions of each itted model using appropriate plots. [6 marks]

(c)  Comment on the proportion of variance that is explained by the predictors under model M3. [2 marks]

3.  Decide which of models M1-M4 best describes the relationship between mmr and gdp. Justify your answer and summarise the relationship between mmr and gdp based on your preferred model. [8 marks]

4.  By considering the addition of the other variables and interactions to your preferred model from question 3, propose a suitable regression model for mmr. Document your model building process and use diagnostic tools to assess the it of your model. [18 marks]

5.  Describe the relationship between mmr and the explanatory variables in your model. [12 marks]

6.  Up to 5 marks will be allocated for general presentation of the results in the report. [5 marks]

Task 2 [Total 35 marks, max. 2 pages]

For this task you need to (a) submit R code using the R template, which will be used to replicate your answers, and (b) include the answers to the questions below in your report. You are not allowed to use existing  R functions that it models. However, you are allowed to use other R functions, for example, those required for matrix algebra com- putations.

The data ile bmd. csv contains 169 records of bone densitometries (measurement of bone mineral density). The following variables were collected:

fracture                Hip fracture (1 = fracture, 0 = no fracture)

bmd                     Bone mineral density measure in the hip

We are interested in formulating a model to study the impact of bone mineral density in the hip, on the probability of a hip fracture.  It will be assumed that the distribution of fracture is Bernoulli with probability of success π, i.e.,

The Bernoulli distribution belongs to the exponential family with the following compo- nents:

Furthermore, E(Y) = μ = π .

Let Y1 , . . . , Yn   be a random sample from (1) and assume that the probability of fracture for individual i, πi  can be modelled as a function of its bone mineral density in the hip xi using the following link function and systematic component,

with πi  = E(Yi ), for i = 1, . . . , n.

1.  Use the expressions provided in the lecture notes and the information above to obtain the score u(β) and the information I(β), where β = (β0 , β1 )T , under the link function and systematic component speciied above. Present your derivations and report the score and information.  For this task you can typeset your derivations in the software of your choice (e.g., Latex or Word) or scan your legible handwritten work. [10 marks]

2.  Using the score and the information, write R code that implements the Fisher scoring algorithm to it a glm to dataset bmd. csv under the distribution speciied in (1) with the link function and systematic component speciied above.  Obtain the maximum likelihood estimate (m.l.e.) of β = (β0 ; β1 ). Report the point estimates of the model parameters. [10 marks]

3.  Calculate and report the variance-covariance matrix of the m.l.e. of β . [5 marks]

4.  Compute the t-statistic for testing the signiicance of β1. Is the variable signiicant? Justify your answer. [5 marks]

5.  Present  well-structured  code  with  brief comments  and  a  concise  but  informative report. [5 marks]

Task 3 [Total 30 marks, max. 5 pages]

Household income is a key variable in socio-economic studies.  Amongst others, it allows us to measure poverty and inequality, and to formulate policies aiming to reduce them. Unfortunately, collecting high quality data is particularly di伍cult. Non-response rates for this variable are typically higher than for other socio-economic variables, such as expen- diture.  Furthermore, even in the cases where a response is obtained, individuals tend to under report their income, particularly those in the right-tail of the distribution.

Given this scenario, a special survey has been designed to collect high quality data on income and expenditure with the aim of assessing whether expenditure could be used as a proxy for income.  As airst step towards that goal, you have been given the task of using a non-parametric regression method to understand the relationship between these variables. A description of the available data is presented below. The dataset (1 200 observations) is included in the ile income. txt.

id Household identiier

income Gross weekly average household income (GBP)

expenditure Total household expenditure (GBP) [Includes food, clothing, transport, housing, education, etc.]

1. Produce a scatterplot of income  against expenditure  and add a non-parametric estimate of the relationship between these two variables using local averages.  Clearly state and justify your choice of bin width. [4 marks]

2. Produce a scatterplot of income  against expenditure  and add a non-parametric estimate of the relationship between these two variables using kernel smoothing with a normal kernel. Clearly state and justify your choice of bandwidth. [4 marks]

3. Produce a scatterplot of income  against expenditure  and add loess curves with degrees 1 and 2.  For each degree, clearly state and justify your choice of span.  Which of the two loess curves do you think better represents the relationship between these two variables? Justify your answer. [6 marks]

4. Produce a scatterplot of income  against expenditure  and add a non-parametric estimate of the relationship between these two variables using natural splines. Clearly state and justify your choice of degrees of freedom. [4 marks]

5. Produce a scatterplot of income against expenditure and add anon-parametric esti- mate of the relationship between these two variables using penalised splines.  Clearly state and justify your choice of degrees of freedom. [4 marks]

6. Which of the curves you have plotted do you think best represents the relationship between income and expenditure?  Justify your answer and summarise in words the relationship between these two variables? [4 marks]

7.  Up to 4 marks will be allocated for general presentation of the results in the report. [4 marks]