Course 1- part 2

Download Report

Transcript Course 1- part 2

Willi Sauerbrei
Institut of Medical Biometry and Informatics
University Medical Center Freiburg, Germany
Patrick Royston
MRC Clinical Trials Unit,
London, UK
The use of fractional polynomials in
multivariable regression modelling
Part II: Coping with continuous
predictors
Overview
•
•
•
•
•
•
•
•
Context, motivation and data sets
The univariate smoothing problem
Introduction to fractional polynomials (FPs)
Multivariable FP (MFP) models
Robustness
Stability
Interactions
Other issues, software, conclusions, references
2
The problem …
“Quantifying epidemiologic risk factors
using non-parametric regression: model
selection remains the greatest challenge”
Rosenberg PS et al, Statistics in Medicine 2003; 22:3369-3381
Trivial nowadays to fit almost any model
To choose a good model is much harder
3
Overview
•
•
•
•
•
•
•
•
Context, motivation and data sets
The univariate smoothing problem
Introduction to fractional polynomials (FPs)
Multivariable FP (MFP) models
Robustness
Stability
Interactions
Other issues, software, conclusions, references
4
Motivation
• Often have continuous risk factors in
epidemiology and clinical studies – how to
model them?
• Linear model may describe a dose-response
relationship badly
– ‘Linear’ = straight line = 0 + 1X + … throughout
talk
• Using cut-points has several problems
• Splines recommended by some – but are not
ideal (discussed briefly later)
5
Problems of cut-points
• Use of cut-points gives a step function
– Poor approximation to the true relationship
– Almost always fits data less well than a suitable
continuous function
• ‘Optimal’ cut-points have several difficulties
– Biased effect estimates
– P-values too small
– Not reproducible in other studies
• Cut-points not considered further here
6
Example datasets
1. Epidemiology
• Whitehall 1
– 17,370 male Civil Servants aged 40-64 years
– Measurements include: age, cigarette smoking,
BP, cholesterol, height, weight, job grade
– Outcomes of interest: coronary heart disease, allcause mortality  logistic regression
– Interested in risk as function of covariates
– Several continuous covariates
• Some may have no influence in multivariable context
7
Example datasets
2. Clinical studies
• German breast cancer study group - BMFT-2 trial
– Prognostic factors in primary breast cancer
– Age, menopausal status, tumour size, grade, no. of positive lymph
nodes, hormone receptor status
– Recurrence-free survival time  Cox regression
– 686 patients, 299 events
– Several continuous covariates
– Interested in prognostic model and effect of individual variables
8
.25
0
.05
.1
.15
.2
Example: all-cause mortality and
cigarette smoking
0
10
20
30
Cigarettes smoked per day (categorised mean)
40
9
Overview
•
•
•
•
•
•
•
•
Context, motivation and data sets
The univariate smoothing problem
Introduction to fractional polynomials (FPs)
Multivariable FP (MFP) models
Robustness
Stability
Interactions
Other issues, software, conclusions, references
10
-.5
Example: all-cause mortality and
cigarette smoking
-3
-2.5
-2
-1.5
-1
Empirical + 90% CI
Linear
Quadratic
FP
0
20
40
Cigarettes smoked per day
60
11
Empirical curve fitting: Aims
• Smoothing
• Visualise relationship of Y with X
• Provide and/or suggest functional form
12
Some approaches
• ‘Non-parametric’ (local-influence) models
– Locally weighted (kernel) fits (e.g. lowess)
– Regression splines
– Smoothing splines (used in generalized additive
models)
• Parametric (non-local influence) models
– Polynomials
– Non-linear curves
– Fractional polynomials
13
Local regression models
• Advantages
– Flexible – because local!
– May reveal ‘true’ curve shape (?)
• Disadvantages
– Unstable – because local!
– No concise form for models
• Therefore, hard for others to use – publication,compare results with those
from other models
– Curves not necessarily smooth
– ‘Black box’ approach
– Many approaches – which one(s) to use?
14
Polynomial models
• Do not have the disadvantages of local
regression models, but do have others:
• Lack of flexibility (low order)
• Artefacts in fitted curves (high order)
• Cannot have asymptotes
An alternative is fractional polynomials
– considered next
15
Overview
•
•
•
•
•
•
•
•
Context, motivation and data sets
The univariate smoothing problem
Introduction to fractional polynomials (FPs)
Multivariable FP (MFP) models
Robustness
Stability
Interactions
Other issues, software, conclusions, references
16
Fractional polynomial models
• Describe for one covariate, X
• Fractional polynomial of degree m for X with
powers p1, … , pm is given by
FPm(X) = 1Xp1 + … + mXpm
• Powers p1,…,pm are taken from a special set
{−2, −1, −0.5, 0, 0.5, 1, 2, 3}
• Usually m = 1 or m = 2 gives a good fit
• These are called FP1 and FP2 models
17
FP1 and FP2 models
• FP1 models are simple power transformations
• 1/X2, 1/X, 1/X, log X, X, X, X2, X3
– 8 models
• FP2 models are combinations of these
– For example 1(1/X) + 2(X2) = powers −1, 2
– 28 models
• Note ‘repeated powers’ models
– E.g. 1(1/X) + 2(1/X)log X = powers −1, −1
– 8 models
18
FP1 and FP2 models:
some properties
• Many useful curves
• A variety of features are available:
– Monotonic
– Can have asymptote
– Non-monotonic (single maximum or minimum)
– Single turning-point
• Get better fit than with conventional
polynomials, even of higher degree
19
Examples of FP2 curves
- varying powers
(-2, 1)
(-2, 2)
(-2, -2)
(-2, -1)
20
Examples of FP2 curves – same
powers, different beta’s
(-2, 2)
4
Y
2
0
-2
-4
10
20
30
x
40
50
21
A philosophy of function
selection
• Prefer simple (linear) model where
appropriate
• Use more complex (non-linear) FP1 or FP2
model if indicated by the data
• Contrast to more local regression modelling
– That may already start with a complex model
22
Estimation and significance
testing for FP models
• Fit model with each combination of powers
– FP1: 8 single powers
– FP2: 36 combinations of powers
• Choose model with lowest deviance (MLE)
• Comparing FPm with FP(m−1):
– Compare deviance difference with 2 on 2 d.f.
– One d.f. for power, 1 d.f. for regression coefficient
– Supported by simulations; slightly conservative
23
FP analysis for the effect of age (breast cancer data;
age is x1)
Degree 1
Power Model
chisquare
-2
6.41
-1
3.39
-0.5
2.32
0
1.53
0.5
0.97
1
0.58
2
0.17
3
0.03
Powers
-2
-2
-2
-2
-2
-2
-2
-2
-1
-1
-1
-1
-2
-1
-0.5
0
0.5
1
2
3
-1
-0.5
0
0.5
Model
chisquare
17.09
17.57
17.61
17.52
17.30
16.97
16.04
14.91
17.58
17.30
16.85
16.25
Degree 2
Powers
Model Powers
chisquare
-1
1
15.56
0
2
-1
2
13.99
0
3
-1
3
12.37 0.5 0.5
-0.5 -0.5
16.82 0.5 1
-0.5
0
16.18 0.5 2
-0.5
0.5
15.41 0.5 3
-0.5
1
14.55
1
1
-0.5
2
12.74
1
2
-0.5
3
10.98
1
3
0
0
15.36
2
2
0
0.5
14.43
2
3
0
1
13.44
3
3
Model
chisquare
11.45
9.61
13.37
12.29
10.19
8.32
11.14
8.99
7.15
6.87
5.17
3.67
7
24
2
FP for age: plot
-1
0
1
Categories (<45, 45-60, >60)
Linear
Best FP2
4 nearly best FP2
25
35
45
55
65
75
Age, years
25
Selection of FP function (1)
Closed test procedure
• General principle developed during 1970’s
• Preserves “familywise” (overall) type I error
probability
• Consider one-way ANOVA with several groups
• Stop if global F-test is not significant
• If significant, where are the differences?
– Test sub-hypotheses
• Stop when no more tests are significant
26
Closed test procedure
Closed test procedure for 4 treatment groups A, B, C, D
27
Selection of FP function (2)
Closed test procedure
•
•
•
•
•
Based on closed test procedure idea
Define nominal P-value for all tests (often 5%)
Use 2 approximations to get P-values
Fit linear, FP1 and FP2 models
Test FP2 vs. null
– Any effect of X at all? (2 on 4 df)
• Test FP2 vs linear
– Non-linear effect of X? (2 on 3 df)
• Test FP2 vs FP1
– More complex or simpler function required? (2 on 2 df)
28
Example: All-cause mortality and
cigarette smoking
Model
FP2 v Null
FP2 v Linear
FP2 v FP1
d.f.
4
3
2
Deviance
difference
265.91
43.80
4.66
Pvalue
0.000
0.000
0.1
FP models:
FP1 has power 0:
1 lnX
FP2 has powers (2, 1): 1 X-1 + 2 X-2
29
-.5
Example: all-cause mortality and
cigarette smoking
-3
-2.5
-2
-1.5
-1
Empirical + 90% CI
Linear
Quadratic
FP
0
20
40
Cigarettes smoked per day
60
30
Why not splines?
• Why care about FPs when splines are more
flexible?
• More flexible  more unstable
• Many approaches – which one to use?
– No standard approach, even in univariate case
• Even more complicated for multivariable case
• In clinical epidemiology, dose-response
relationships are often simple
31
Example: Alcohol consumption and oral
cancer
OR for drinkers
“Quantifying epidemiologic risk factors using non-parametric regression: model selection remains the
greatest challenge” Rosenberg PS et al, Statistics in Medicine 2003; 22:3369-3381
32
Overview
•
•
•
•
•
•
•
•
Context, motivation and data sets
The univariate smoothing problem
Introduction to fractional polynomials (FPs)
Multivariable FP (MFP) models
Robustness
Stability
Interactions
Other issues, software, conclusions, references
33
Multivariable FP (MFP) models
• Typically, have a mix of continuous and binary
covariates
– Dummy variables for categorical predictors
• Wish to find ‘best’ multivariable FP model
• Impractical to try all combinations of powers
for all continuous covariates
• Requires iterative fitting procedure
34
The MFP algorithm
• COMBINE backward elimination with a search for the best FP
functions
• START: Determine fitting order from linear model
• UPDATE: Apply univariate FP model selection procedure to
each continuous X in turn, adjusting for (last FP function of)
each other X
• UPDATE: Binary covariates similarly – but just in/out of model
• CYCLE: until convergence – usually 2-3 cycles
Will be demonstrated on the computer
35
Example: Prognostic factors in
breast cancer
• Aim to develop a prognostic index for risk of
tumour recurrence or death
• Have 7 prognostic factors
– 5 continuous, 2 categorical
• Select variables and functions using 5%
significance level
36
Univariate linear analysis
Variable
X1
X2
X3
X4a
X4b
X5
X6
X7
Name
Age
Menopausal status
Tumour size
Grade 2 or 3
Grade 3
No. of positive lymph nodes
Progesterone receptor status
Oestrogen receptor status
2
0.58
0.28
15.68
19.92
8.19
50.02
34.04
4.70
37
Univariate FP2 analysis
Variable
X1 age
X3 size
X5 nodes
X6 PgR
X7 ER
Powers
(2, 0.5)
(1, 3)
(1, 2)
(0.5, 0)
(2, 1)
2 d.f.
17.61
4
19.81
4
81.36
4
52.73
4
23.07
4
P
0.001
0.001
< 0.001
< 0.001
< 0.001
Gain
17.03
4.13
31.34
18.69
18.37
‘Gain’ assesses non-linearity (chi-square comparing
FP2 with linear function, on 3 d.f.)
All factors except for X3 have a non-linear effect
38
Multivariable FP analysis
Variable
X1 age
X3 size
X5 nodes
X6 PgR
X7 ER
X2 mens.
X4a grad 2/3
X4b grad 3
FP etc.
(2, 0.5)
Out
(2, 1)
0.5
Out
Out
In
Out
2
19.33
5.31
74.14
32.70
2.15
0.21
4.59
0.15
d.f.
P
4
0.001
4
0.3
4 <0.001
4 <0.001
4
0.7
1
0.6
1
0.03
1
0.7
P is P-to-enter for ‘Out’ variable, P-to-remove for ‘In’ variable
39
Computer demo of mfp in Stata
• Fit full model for ordering of variables
• Show mfp stcox x1 x2 x3 x4a x4b x5 x6 x7
hormon, select(0.05, hormon:1)
• Show fracplot (use scheme lean1 for CIs to
show up on beamer)
40
Comments on analysis
• Conventional backwards elimination at 5% level selects x4a,
x5, x6, and x1 is excluded
• FP analysis picks up same variables as backward elimination,
and additionally x1
• Note considerable non-linearity of x1 and x5
• x1 has no linear influence on risk of recurrence
• FP model detects more structure in the data than the linear
model
41
Presentation of FP models:
Plots of fitted FP functions
Breast cancer: Fitted FP functions
1
Nodes
20
40
.5
0
-.5
-1
0
1
2
3
4
Log relative hazard
5
Age
60
80
Age, years
0
10
20
30
40
No. of positive lymph nodes
50
-3
-2
-1
0
1
Progesterone receptor
0
500
1000
1500
2000
Progesterone receptor status
2500
42
Presentation of FP models:
an approach to tabulation
• The function + 95% CI gives the whole story
• Functions for important covariates should
always be plotted
• In epidemiology, sometimes useful to give a
more conventional table of results in
categories
• This can be done from the fitted function
43
Example: Smoking and all-cause
mortality (Whitehall 1)
Cigarettes per day
Number
OR (model based)
Range
Ref. At risk Dying Estimate 95% CI
point
0 (referent) 0
10103 690
1.00
-1-10
5
2254 243
1.69
1.59, 1.80
11-20
15
3448 494
2.25
2.04, 2.49
21-30
25
1117 185
2.60
2.31, 2.91
31-40
35
283
48
2.86
2.52, 3.24
41-50
45
43
8
3.07
2.68, 3.52
51-60
55
12
2
3.25
2.82, 3.75
Calculation of CI: see Royston, Ambler & Sauerbrei (1999)
44
Overview
•
•
•
•
•
•
•
•
Context, motivation and data sets
The univariate smoothing problem
Introduction to fractional polynomials (FPs)
Multivariable FP (MFP) models
Robustness
Stability
Interactions
Other issues, software, conclusions, references
45
Robustness of FP functions
• Breast cancer example showed non-robust functions for
nodes – not medically sensible
• Situation can be improved by performing covariate
transformation before FP analysis
• Can be done systematically (Royston & Sauerbrei 2006)
• Sauerbrei & Royston (1999) used negative exponential
transformation of nodes
– exp(–0.12 * number of nodes)
46
An approach to robustification
(Royston & Sauerbrei 2006)
• Similar in spirit to double truncation of
extreme covariate values
• Reduces the leverage of extreme values
– Particularly important after extreme FP
transformations – powers -2 or 3
• Also includes a linear shift of origin to the
right
47
.2
.4
.6
.8
1
Robustifying transformation of X
-4
-2.783 -2
0
2
2.783
4
z [= (x - mean)/SD]
48
Exponential
Robust
1
.5
0
0
-.5
.1
Density
.2
Log relative hazard
FP2 (-2, -1)
1.5
.3
Making the function for lymph nodes
more robust
0
10
20
30
40
50
No. of positive lymph nodes
49
2nd example: Whitehall 1
MFP analysis and robustness
Covariate
Age
Cigarettes
Systolic BP
Total cholesterol
Height
Weight
Job grade
FP etc.
Linear
0.5
-1, -0.5
Linear
Linear
-2, 3
In
No variables were eliminated by the MFP algorithm
(Weight eliminated by linear backward elimination)
50
Plots of FP functions
Whitehall 1: multivariable FP analysis
Cigarettes
.4
.3
.2
.1
.1
Probability of death
.5
Systolic BP
.08
.05
.1
.15
Probability of death
.2
.12 .14 .16 .18
Age
45
50 55 60
Age at entry
65
0
20
40
Cigarettes/day
5
10
Cholesterol/ mmol/l
100 150 200 250 300
Systolic BP
15
40
60
Height
.08 .09
.1
Probability of death
.2
.1
.12 .14 .16 .18
Probability of death
.14
.12
.1
.08
0
50
Weight
.16
Total cholesterol
60
.11 .12 .13
40
80 100 120 140
Weight/kgs
140
160
180
Height/cms
200
51
Robustified analysis (all variables)
Whitehall 1: multivariable FP analysis (2)
Cigarettes
.4
.3
.2
.1
.1
Probability of death
.5
Systolic BP
.08
.05
.1
.15
Probability of death
.2
.12 .14 .16 .18
Age
45
50 55 60
Age at entry
65
0
20
40
Cigarettes/day
5
10
Cholesterol/ mmol/l
100 150 200 250 300
Systolic BP
15
40
60
Height
.08 .09
.1
Probability of death
.2
.1
.12 .14 .16 .18
Probability of death
.14
.12
.1
.08
0
50
Weight
.16
Total cholesterol
60
.11 .12 .13
40
80 100 120 140
Weight/kgs
140
160
180
Height/cms
200
52
Overview
•
•
•
•
•
•
•
•
Context, motivation and data sets
The univariate smoothing problem
Introduction to fractional polynomials (FPs)
Multivariable FP (MFP) models
Robustness
Stability
Interactions
Other issues, software, conclusions, references
53
Stability (1)
• As explained in Part I:
• Models (variables, FP functions) selected by
statistical criteria – cut-off on P-value
• Approach has several advantages …
• … and also is known to have problems
– Omission bias
– Selection bias
– Unstable – many models may fit equally well
54
Stability (2)
• Instability may be studied by bootstrap
resampling (sampling with replacement)
– Take bootstrap sample B times
– Select model by chosen procedure
– Count how many times each variable and each type of simplified
function (e.g. monotonic) is selected
– Summarise inclusion frequencies & their dependencies
– Study fitted functions for each covariate
• May lead to choosing several possible
models, or a model different from the
original one
55
Bootstrap stability analysis:
breast cancer dataset (1)
• 5760 models considered – MFP selects one
• 5000 bootstrap samples taken
• MFP algorithm with Cox model applied to
each bootstrap sample
• Resulted in 1222 different models (!!)
• Nevertheless, could identify stable subset
consisting of 60% of replications
– Judged by similarity of functions selected
56
Bootstrap stability analysis: breast
cancer dataset (2)
Variable
Model
selected
Age
FP1
FP2
Menopausal status
—
Tumour size
FP1
FP2
Grade 2/3
—
Grade 3
—
Lymph nodes
FP1
Progesterone receptors
FP1
FP2
Oestrogen receptors
FP1
FP2
% bootstraps
model selected
16
76
20
34
6
58
9
100
95
4
13
6
57
Bootstrap analysis: fitted curves
from stable subset
Log relative hazard
6
1
0
4
-1
2
-2
-3
0
20
30
40
50
60
Age, years
70
80
Log relative hazard
2
0
25
50
75
Tumour size, mm
100
0
250
PgR, fmol/L
500
1
1
0
0
-1
-1
0
10
20
30
Number of positive lymph nodes
58
Overview
•
•
•
•
•
•
•
•
Context, motivation and data sets
The univariate smoothing problem
Introduction to fractional polynomials (FPs)
Multivariable FP (MFP) models
Robustness
Stability
Interactions
Other issues, software, conclusions, references
59
Interactions
• Interactions are often ignored by analysts
• Continuous  categorical has been studied in
FP context because clinically very important
– Treatment-covariate interaction in clinical trial
– ‘MFPI’ method – Royston & Sauerbrei (2004)
• Continuous  continuous is the most complex
– not yet done
60
Interactions – MFPI method
• Have continuous X of interest, binary treatment variable T and
other covariates Z
• Select ‘adjustment’ model Z* on Z using MFP
• Find best FP2 function of X (in all patients) adjusting for Z*
and T
• Test FP2(X)  T interaction (2 d.f.)
– Estimate β’s separately in 2 treatment groups
– Standard test for equality of β’s
• May also consider simpler FP1 and linear functions
61
Interactions – treatment effect
function
• Have estimated two FP2 functions – one per
treatment group
• Plot difference between functions against X to
show the interaction
– i.e. the treatment effect at different X
• Pointwise 95% CI shows how strongly the
interaction is supported at different values of
X
– i.e. variation in the treatment effect
62
Example: MRC RE01 trial – MPA and interferon in kidney
1.00
cancer
0.00
0.25
0.50
0.75
(1) MPA
(2) Interferon
At risk 1:
175
55
22
11
3
2
1
At risk 2:
172
73
36
20
8
5
1
0
12
24
36
48
60
72
Follow-up (months)
63
Overall: Interferon is better
• P < 0.01; HR = 0.75; 95% CI (0.60, 0.93)
• Is the treatment effect similar in all
patients? Sensible question?
– Yes, from our point of view
• Ten possible covariates available for the
investigation of treatment-covariate
interactions – only one is significant (WCC)
64
Analysis with the MFPI procedure: Treatment effect plot
-4
-2
0
2
Original data
5
10
White cell count
15
Only a result of complex (mis-)modelling?
20
Does model agree with data?
Check proposed trend
Treatment effect in subgroups defined by WCC
0
12
24
36
48
60
72
12
24
36
48
0
12
60
Follow-up (months)
72
24
36
48
60
72
Group IV
0.00 0.25 0.50 0.75 1.00
0.00 0.25 0.50 0.75 1.00
Group III
0
Group II
0.00 0.25 0.50 0.75 1.00
0.00 0.25 0.50 0.75 1.00
Group I
0
12
24
36
48
60
72
Follow-up (months)
HR (Interferon to MPA; adjusted values similar) overall: 0.75 (0.60 – 0.93)
I : 0.53 (0.34 – 0.83) II : 0.69 (0.44 – 1.07)
III : 0.89 (0.57 – 1.37) IV : 1.32 (0.85 –2.05)
66
Interactions in clinical trials –
general issues
• Many correctly criticise ‘subgroup analyses’
– E.g. Assmann et al (2000)
– We avoid subgrouping X
• Several covariates – multiple testing is an
obvious problem
• Distinguish hypothesis generation from testing
pre-specified interaction(s)
• Complex modelling – check of the function is
necessary
67
Overview
•
•
•
•
•
•
•
•
Context, motivation and data sets
The univariate smoothing problem
Introduction to fractional polynomials (FPs)
Multivariable FP (MFP) models
Robustness
Stability
Interactions
Other issues, software, conclusions, references
68
Other issues (1)
• Handling continuous confounders
– May use a larger P-value for selection e.g. 0.2
– Not so concerned about functional form here
69
Other issues (2)
• Time-varying effects in survival analysis
– Can be modelled using FP functions of time
(Berger, 2003; also Sauerbrei & Royston,
submitted 2006)
• Checking adequacy of FP functions
– May be done by using splines
– Fit FP function and see if spline function adds
anything, adjusting for the fitted FP function
70
Software sources
• Most comprehensive implementation - Stata
– Command mfp is part of Stata 8/9
• Versions for SAS and R are also available
– Visit
http://www.imbi.uni-freiburg.de/biom/mfp
to download a copy of the SAS macro
– R version available on CRAN archive - mfp package
71
SAS: example of command
• See Sauerbrei et al (2006)
• Syntax diagram earlier in this paper:
72
SAS syntax diagram
73
Concluding remarks (1)
• FP method in general
– No reason (other than convention) why regression
models should include only positive integer powers of
covariates
– FP is a simple extension of an existing method
– Simple to program and simple to explain
– Parametric, so can easily get predicted values
– FP usually gives better fit than standard polynomials
– Cannot do worse, since standard polynomials are
included
74
Concluding remarks (2)
• Multivariable FP modelling
– Many applications in general context of multiple
regression modelling
– Well-defined procedure based on standard
principles for selecting variables and functions
– Aspects of robustness and stability have been
investigated (and methods are available)
– Much experience gained so far suggests that
method is very useful in clinical epidemiology
75