Professional Documents
Culture Documents
Patrick Royston
MRC Clinical Trials Unit , London
10 September 2010
Overview
(-2, 2)
(-2, -2)
(-2, -1)
df
P-value
Any effect?
Best FP2 versus null
17.61
0.0015
17.03
0.0007
FP1 sufficient?
Best FP2 vs. best FP1
11.20
0.0037
fracpoly command
Basic syntax:
. fracpoly [, fp_options]: regn_cmd [yvar] xvar1 [xvars]
xvar1 is a continuous predictor which may have a curved
relationship with yvar
xvars are other predictors, all modelled as linear
Can use the fp_option compare to compare the fit of
different FP models
uses the FP function selection procedure
4.5
Log AC
5
5.5
10
20
30
Gestational age, wk
40
-.2
4.5
Residuals
-.1
0
.1
Log AC
5
5.5
.2
10
20
30
Gestational age, wk
40
-.2
Residuals
-.1
0
.1
.2
10
20
30
Gestational age, wk
40
10
20
30
Gestational age, wk
40
An ignorant example!
Example (ctd.)
Stata
gen x1 = socst
gen x2 = science
gen y1 = read
gen y2 = math
local devmin 1e30
forvalues j = 1 / `np' {
qui fracgen x1 `p`j'', replace adjust(mean)
local x1vars `r(names)'
forvalues k = 1 / `np' {
qui fracgen x2 `p`k'', replace adjust(mean)
local x2vars `r(names)'
qui sureg (y1 `x1vars' female ses) (y2 `x2vars' female ses)
local dev = -2 * e(ll)
if `dev' < `devmin' {
local px1 `p`j''
local px2 `p`k''
local devmin `dev'
}
}
}
Comments
30
80
30
40
50
social studies score
60
70
30
80
20
40
science score
60
80
Conclusions