Fill This Form To Receive Instant Help
Homework answers / question archive / Instructions for assignment: Please use the latest version of R (Version 4
Instructions for assignment: Please use the latest version of R (Version 4.1.3) and RStudio (Version 2022.02.0) to complete this assignment. You will need to submit two documents for this assignment. The first document is a pdf document named Assign1 StNo.pdf which will provide all your analysis and solutions for this assignment. To produce this pdf document you will need to use LaTeX. The LaTeX document which was used to produce this assignment is named Assign1 StNo.tex and is located in the Assignment 1 folder in the Topic 4 section of LMS. You can use LaTeX online via Overleaf which is a website dedicated to producing documents from LaTeX. To use LaTeX, follow the instructions in the Overleaf.pdf document located in the Assignment 1 folder. The second document that you will need to submit is an R document named Assign1 R StNo.R which is located in the Assignment 1 folder. This document should provide the R code you used to perform all your data manipulation and analysis.
Assessment information for assignment: There are a total of 50 marks for this assignment.
Description of assignment: The data and information presented in this assignment is adapted from a clinical trial presented in Gregoire et al. (1996)[1] and is stored in the file named Postnatal.csv located in the Assignment 1 folder in the Topic 4 section of LMS. Women with major depression which began within 3 months of child-birth were randomly assigned to the treatment group or to the placebo group. The treatment group consisted of patients using the Estrogen patch and the placebo group was made up of patients using the Placebo patch. The women were assessed pre-treatment (directly before administration of the treatment) and at post-treatment (1 month, 2 months, 3 months, 4 months, 5 months and 6 months after the administration of the treatment), using the Edinburgh postnatal depression scale (EPDS). This scale ranges from 0 to 30 and a score of at least 10 is regarded as possible depression. The variables of interest for Assignment 1 are:
2 marks are allocated for each question that requires the use of the R computer package. These marks are awarded using the following criterion:
1. R code that accurately produces the analysis/output required in the question.
Answer the following questions.
(3 marks)
Figure 1: Plot of mean E vs M grouped by T
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30
25
20
E_mean |
15
10
5
0
0 1 2 3 4 5
M
Figure 2: Plot of E vs M for each Patient grouped by T
0 |
1 |
0 |
1 |
2 |
3 |
4 |
5 |
0 |
1 |
2 |
3 |
4 |
5 |
0 |
5 |
10 |
15 |
20 |
25 |
30 |
M |
E |
The researchers in the study set up the following linear mixed model to analyze their research questions.
Eti = β0 + β1 Pi + β2 Ti + β3 Mti + β4 Pi × Ti + β5 Pi × Mti + β6 Ti × Mti
+ µ0i + µ1i Mti + εti, (1)
For model (1), the researchers choose an unstructured structure for the variance-covariance matrix of the random effect vector, µi. That is, the variance-covariance matrix of the random effect vector, µi, is
ñ ψ ψ ô
D
,
Also for model (1), the researchers choose a diagonal structure for the variance-covariance matrix of the random error vector, εi. That is, the variance-covariance matrix of the random error vector, εi, is
? θ ? 0 ? ? 0 R = ?? ? 0 ? ? 0 ? 0 |
0 θ 0 0 0 0 |
0 0 θ 0 0 0 |
0 0 0 θ 0 0 |
0 0 0 0 θ 0 |
0 ? 0 ? ? 0 ??. 0 ?? ? 0 ?? θ |
3. The researchers would like to express model (1) in matrix form, Yi = Xi β + Zi µi + εi, where Yi represents the response vector for patient i, Xi represents a matrix, for patient i, that contains the values of the predictors associated with the fixed effects of model (1), β is the fixed effect vector, Zi is a matrix, for patient i, that contains the values of the predictors associated with the random effects of model (1), µi is the random effect vector for patient i and εi is the random error vector for patient i. Answer the following questions.
4. The researchers would like to test whether the random effect of M should be included in model (1). They decide to test, at the 5% significance level, the null hypothesis H0 : ψ1 = 0 vs the alternative hypothesis H1 : ψ1 > 0 using the REML-based likelihood ratio test p-value.
[1] Gregoire, A. J. P., Kumar, R., Everitt, B. S., Henderson, A. F., &Studd, J. W. W. (1996). Transdermal oestrogen for the treatment of severe postnatal depression. Lancet, 347: 930–933.
Please download the answer file using this link
https://drive.google.com/file/d/18BT5wwj9Tl47c13ybBcXegE7jHRbW_Tr/view?usp=sharing