Chapter 4 Inference II
1.
Download the csv-file Melanoma.csv to your computer. Read it into R using read.csv()
and assign it the name melanoma
. All following exercises in this chapter refer to that data set. (Find help in Chapter 2.3)
2.
Compute the risks and the risk ratio for having an ulcer (variable ulcer
) for male and female patient (variable sex
). Also compute the odds ratio. Is there a significant difference in ulcers between men and women? (Find help in Chapter 4.1)
3.
Compute the linear regression of thickness
on sex
. What is the mean thickness
predicted for a male (sex
= 1) patient? (Find help in Chapter 4.1)
4.
Compute the linear regression of thickness
on sex
, age
and ulcer
. Explain why the p-value for sex
changes compared to the previous regression. (Find help in Chapter 4.1.3)
5. How does the percentage of explained variance increase from the model in 3. to the model in 4.? (Find help in Chapter 4.1.2)
6.
Which thickness
would the model from 4. predict for a female patient aged 50 years, who does not have an ulcer (ulcer
= 0)? (Find help in Chapter 4.1.3)
7. Compute a logistic regression relating the presence of an ulcer to the age and sex of a patient. Interpret the results. (Find help in Chapter 4.1.4)
8.
Create a new variable event
which takes the value 0 if the patient is alive or died from something other than melanoma (status
= 2 or 3) and the value 1 if the patient died from melanoma (status
= 1). (Find help in Chapter 3.1.4)
9.
Plot the Kaplan-Meier estimates for the survival of the melanoma patients stratified by the variable ulcer
. Use the variable created in the previous exercise to do so. Is there a significant difference in the survival probability of ulcer vs. non-ulcer patients? (Find help in Chapter 4.2)