Prediction Models

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/26

encourage image

There's no tags or description

Looks like no tags are added yet.

27 Terms

1
New cards

Difference between association and prediction models

Association

Prediction

Interested in the effect of a variable

Interested in predicted outcome

Usually focuses on a particular exposure

Uses multiple covariates

Confounding is important

Predictive performance is important

In association studies, we often ask whether a coefficient is statistically significant.

In prediction studies, a statistically significant coefficient does not automatically mean the model predicts patients accurately.

2
New cards

What is the adjusted effect

Each coefficient is interpreted while keeping the other variables constant.

3
New cards

What is R squared

Imagine 100 patients have different cholesterol levels.

Some have cholesterol of 4, some 5, some 6, and others 8.

There is variation between patients.

The better the model explains the variation, the higher its R-squared.

R2 always between 0 and 1

R² value

Interpretation

0

Model explains none of the variation

0.25

Explains 25% of variation

0.50

Explains 50% of variation

0.75

Explains 75% of variation

1

Explains 100% of variation

Eg: 75% of the variation in cholesterol is explained by sex, age and BMI.

This means 25% of the variation is not explained by our model.

<p>Imagine 100 patients have different cholesterol levels.</p><p>Some have cholesterol of 4, some 5, some 6, and others 8.</p><p>There is variation between patients.</p><p>The better the model explains the variation, the higher its R-squared.</p><p><em>R</em>2 always between 0 and 1</p><table style="min-width: 50px;"><colgroup><col style="min-width: 25px;"><col style="min-width: 25px;"></colgroup><tbody><tr><th colspan="1" rowspan="1"><p>R² value</p></th><th colspan="1" rowspan="1"><p>Interpretation</p></th></tr><tr><td colspan="1" rowspan="1"><p>0</p></td><td colspan="1" rowspan="1"><p>Model explains none of the variation</p></td></tr><tr><td colspan="1" rowspan="1"><p>0.25</p></td><td colspan="1" rowspan="1"><p>Explains 25% of variation</p></td></tr><tr><td colspan="1" rowspan="1"><p>0.50</p></td><td colspan="1" rowspan="1"><p>Explains 50% of variation</p></td></tr><tr><td colspan="1" rowspan="1"><p>0.75</p></td><td colspan="1" rowspan="1"><p>Explains 75% of variation</p></td></tr><tr><td colspan="1" rowspan="1"><p>1</p></td><td colspan="1" rowspan="1"><p>Explains 100% of variation</p></td></tr></tbody></table><p>Eg: 75% of the variation in cholesterol is explained by sex, age and BMI.</p><p>This means 25% of the variation is not explained by our model.</p>
4
New cards

What is overfitting

The model has memorised the training data instead of learning patterns that generalise to unseen data.

5
New cards

A prediction model achieves 98% accuracy on training data but only 65% accuracy on test data. What is the most likely explanation?

Ovefitting

6
New cards

What is the purpose of F test in nested models

Two models are nested when the smaller model is contained within the larger model.

For example:

Model 1:

\[ Cholesterol=b_0+b_1(sex) \]

Model 2:

\[ Cholesterol=b_0+b_1(sex)+b_2(age)+b_3(BMI) \]

Model 1 is nested within Model 2 because Model 2 contains all the variables from Model 1, plus additional variables.

The question is:

Does adding age and BMI significantly improve the model?

The F-test evaluates whether the additional variables improve the fit enough to justify the extra complexity.

7
New cards

Multiple linear regression assumptions

Assumption 1: Residuals are normally distributed with mean zero.

Residual=Observed value-Predicted value.

in a QQplot, If the points follow the diagonal line: Residuals are approximately normally distributed.

If the points deviate substantially from the line: There may be a violation of normality.

Assumption 2: Equal variance of residuals/ homoscedasticity

The variance of the errors should be approximately equal for all subjects.

Assumption 3: Linear contributions of covariates.

The relationship between each continuous covariate and the outcome should be approximately linear, while keeping the other covariates constant.

8
New cards

Which test compares nested linear regression models?

F test

9
New cards

What tool you use to measure variation in the outcome is explained by the logistic regression model? (In linear regression, it is r squared)

  1. Area Under the ROC Curve (AUC).

  2. Nagelkerke's R²- It is a pseudo-R² measure


10
New cards

What does the ROC curve plot?

Sensitivity against 1 − specificity

ROC and AUC help us:

  1. Evaluate how well a prediction model distinguishes between groups.

  2. Compare different prediction models.

  3. Understand the trade-off between sensitivity and false positive rate at different cut-offs.


11
New cards

AUC

Measures the model's ability to discriminate between cases and controls

AUC value

Interpretation

1.0

Perfect discrimination

0.9–1.0

Excellent

0.8–0.9

Good

0.7–0.8

Acceptable

0.5

No better than random guessing

Below 0.5

Worse than random

Important: An AUC of 0.85 means that if you randomly select one patient with cancer and one without cancer, the model has an 85% probability of assigning a higher predicted risk to the patient with cancer.


12
New cards

What is a Good logistic regression model:


•High Nagelkerke’s R2 and AUC (i.e. closer to 1)

13
New cards

Difference between discimination and calibration

Discrimination

Calibration

Correct ranking of patients

Accuracy of predicted probabilities

Evaluated using AUC

Evaluated by comparing predicted and observed risks

Who is at higher risk?

Is the predicted risk accurate?

A high AUC does not guarantee good calibration.






14
New cards

Regression model

Comparing nested models

Linear regression

F-test

Logistic regression

Likelihood Ratio test

Cox regression

Likelihood Ratio test


15
New cards

Methods for variable selection/stepwiseselection. What are the limitations

Method

Starting point

What happens?

Forward

Empty model

Adds variables

Backward

Full model

Removes variables

Stepwise

Usually empty model

Adds and can remove variables

Best subset

Candidate combinations

Compares subsets

Problem 1: It does not prevent overfitting.

Problem 2: It biases standard errors, confidence intervals and p-values.

16
New cards

What is Akaike Information Criterion (AIC).

AIC helps us choose between competing statistical models.

AIC balances:

  • How well the model fits the data.

  • How complex the model is.

Low AIC is preferred

17
New cards

How do we make sure our model does not have overfitting

Internal & external validation

Internal validation

External validation

Uses a hold-out sample from the original dataset

Uses independent external data

Same original source population

Different external population or setting

Evaluates performance beyond the development sample

Evaluates transportability to another setting


18
New cards

Lower MSE = Better predictions. Explain

Patient

Actual value

Predicted value

A

10

8

B

20

18

C

30

25


<table style="min-width: 75px;"><colgroup><col style="min-width: 25px;"><col style="min-width: 25px;"><col style="min-width: 25px;"></colgroup><tbody><tr><th colspan="1" rowspan="1"><p>Patient</p></th><th colspan="1" rowspan="1"><p>Actual value</p></th><th colspan="1" rowspan="1"><p>Predicted value</p></th></tr><tr><td colspan="1" rowspan="1"><p>A</p></td><td colspan="1" rowspan="1"><p>10</p></td><td colspan="1" rowspan="1"><p>8</p></td></tr><tr><td colspan="1" rowspan="1"><p>B</p></td><td colspan="1" rowspan="1"><p>20</p></td><td colspan="1" rowspan="1"><p>18</p></td></tr><tr><td colspan="1" rowspan="1"><p>C</p></td><td colspan="1" rowspan="1"><p>30</p></td><td colspan="1" rowspan="1"><p>25</p></td></tr></tbody></table><p></p>
19
New cards

What is a Brier score

For binary outcome models, the mean squared prediction error is called the Brier score.


  • Continuous outcomes → MSE.

  • Binary outcomes → Brier score.


20
New cards

How many patients do we need to develop a prediction model?/ How to calculate the sample size

1. Linear regression

The rule is: 𝑛≥10x𝑘

Where:

  • \(n\) = Total sample size.

  • \(k\) = Number of covariates.


2. Logistic regression and Cox regression

take 𝑛 such that you have at least 10⋅𝑘

events and at least 10⋅𝑘non-events

21
New cards
term image
22
New cards
term image
23
New cards

A researcher wants to develop a prediction model for tumour volume (cm³) in patients diagnosed with colorectal cancer.

The following variables are available:

  • Age (years)

  • BMI

  • Sex (male/female)

  • Smoking status (yes/no)

The researcher fits a multiple linear regression model using all available predictors.

a) Which type of regression model is appropriate for this outcome? Explain your answer. (1 point)

b) The estimated regression coefficient for age is 0.45. Interpret this coefficient in the context of the study. (1 point)

c) Name two assumptions of multiple linear regression and explain how you would assess them. (2 points)

24
New cards

A researcher investigates whether age, BMI, smoking status and tumour stage can predict the change in tumour volume after six months of treatment.

The dataset is called cancer.

The researcher wants to develop a prediction model using all available predictors, followed by stepwise variable selection.

a) R-question. Write the R code to fit a full multiple linear regression model predicting tumour_change using all available variables. (1 point)

b) R-question. Write the R code to perform stepwise variable selection using AIC, allowing both forward and backward selection. (1 point)

c) The full model has an AIC of 245, whereas the stepwise model has an AIC of 218. Which model would you prefer based on AIC? Explain why. (1 point)

d) Explain why stepwise selection does not guarantee that the final model will perform well in new patients. (1 point)

25
New cards

A research team investigates whether age, smoking status and tumour stage can predict whether a patient develops cancer recurrence within two years (yes/no).

The following logistic regression output is obtained:

Variable

Estimate

p-value

Intercept

-3.00

0.001

Age

0.04

0.020

Smoking

0.80

0.005

Tumour stage

1.20

0.001

a) Which regression model is appropriate for this outcome? (0.5 points)

b) Calculate the odds ratio associated with smoking. Interpret your answer. (1 point)

c) Calculate the predicted probability of cancer recurrence for a patient who is:

  • 60 years old

  • Smoker (smoking = 1)

  • Tumour stage = 2

Use the following equation:

\[ \begin{aligned} \text{Log-odds}={}&-3.00\\ &+0.04(\text{age})\\ &+0.80(\text{smoking})\\ &+1.20(\text{stage}) \end{aligned} \]

Convert your result into a probability. (2 points)

d) Why can we not directly interpret the regression coefficient of smoking as an increase in probability? (0.5 points)

26
New cards

A hospital develops two logistic regression models to predict whether patients develop sepsis.

The models are evaluated using the same independent validation dataset.

Performance measure

Model A

Model B

AUC

0.85

0.72

Brier score

0.18

0.12

Nagelkerke's R²

0.40

0.32

a) Which model has better discriminatory ability? Explain your answer. (1 point)

b) Which model has better predictive accuracy according to the Brier score? Explain your answer. (1 point)

c) Explain the difference between discrimination and calibration. (1 point)

d) Can you conclude that Model A is better overall than Model B based on these results? Explain your reasoning. (1 point)

27
New cards

A researcher develops a linear regression model to predict survival-related biomarker levels using 50 candidate predictors in 100 patients.

The model produces the following results:

Performance measure

Training data

Independent test data

R²

0.78

-0.15

MSE

4.2

18.5

a) What is overfitting? (1 point)

b) Explain why the model has a high R² in the training data but a negative R² in the test data. (1 point)

c) What does a negative out-of-sample R² indicate? (1 point)

d) Explain why external validation is important before implementing a prediction model in clinical practice. (1 point)