📄 mfp.hlp
字号:
{smcl}
{* 07mar2005}{...}
{cmd:help mfp}{right:dialog: {bf:{dialog mfp}}{space 15}}
{right:also see: {help mfp postestimation}}
{hline}
{title:Title}
{p2colset 5 16 18 2}{...}
{p2col :{hi:[R] mfp} {hline 2}}Multivariable fractional polynomial
models{p_end}
{p2colreset}{...}
{title:Syntax}
{p 8 12 2}
{cmd:mfp}
{it:{help mfp##syntax:regression_cmd}}
{it:{help mfp##syntax:yvar}}
{it:{help mfp##syntax:xvarlist}}
{ifin}
{weight}
[{cmd:,} {it:options}]
{synoptset 26 tabbed}{...}
{synopthdr}
{synoptline}
{syntab :Model 2}
{synopt :{opt seq:uential}}use the Royston and Altman model-selection algorithm;
default uses closed-test algorithm{p_end}
{synopt :{opt cyc:les(#)}}maximum number of iteration cycles; default is
{cmd:cycles(5)}{p_end}
{synopt :{opt dfd:efault(#)}}default maximum degrees of freedom; default is
{cmd:dfdefault(4)}{p_end}
{synopt :{opt adj:ust(adj_list)}}adjustment for each predictor{p_end}
{synopt :{opt al:pha(alpha_list)}}p-values for testing between FP models;
default is {cmd:alpha(0.05)}{p_end}
{synopt :{opt df(df_list)}}degrees of freedom for each predictor{p_end}
{synopt :{opt po:wers(numlist)}}list of fractional polynomial powers to use;
default is {bind:{cmd:powers(-2 -1(.5)1 2 3)}}{p_end}
{syntab :Adv. model}
{synopt :{cmdab:xo:rder(+}|{cmd:-}|{cmd:n)}}order of entry into model-selection
algorithm; default is {cmd:xorder(+)}{p_end}
{synopt :{opt sel:ect(select_list)}}nominal p-values for selection on each
predictor{p_end}
{synopt :{opt xp:owers(xp_list)}}fractional polynomial powers for each
predictor{p_end}
{synopt :{opth zer:o(varlist)}}treat nonpositive values of specified predictors
as zero when FP is transformed{p_end}
{synopt :{opth cat:zero(varlist)}}add indicator variable for specified
predictors{p_end}
{synopt :{it:regression_cmd_options}}other options accepted by chosen
regression commands{p_end}
{synoptline}
{p2colreset}{...}
{p 4 6 2}
All weight types supported by {it:regression_cmd} are allowed; see {help weight}.{p_end}
{p 4 6 2}
See {help mfp postestimation} for features available after estimation.{p_end}
{p 4 6 2}
{opt fracgen} may be used to create new variables containing fractional
polynomial powers. See {helpb fracpoly}.{p_end}
{pstd}
{marker syntax}where
{pin}
{it:regression_cmd} may be
{helpb clogit},
{helpb glm},
{helpb logistic},
{helpb logit},
{helpb poisson},
{helpb probit},
{helpb qreg},
{helpb regress},
{helpb stcox},
{helpb streg},
or
{helpb xtgee}.
{pin}
{it:yvar} is not allowed for {opt streg} and {opt stcox}. For these commands,
you must first {helpb stset} your data.
{pin}
{it:xvarlist} has elements of type {varlist} and/or {opt (varlist)};
e.g.,
{pin2}
{cmd:x1 x2 (x3 x4 x5)}
{pin}
Elements enclosed in parentheses are tested jointly for inclusion in the
model and are not eligible for fractional polynomial transformation.
{title:Description}
{pstd}
{opt mfp} selects the fractional polynomial (FP) model that best predicts the
outcome variable from the RHS variables in {it:xvarlist}.
{title:Options}
{dlgtab:Model 2}
{phang}
{opt sequential} chooses the sequential FP selection algorithm.
{phang}
{opt cycles(#)} sets the maximum number of iteration cycles
permitted. {cmd:cycles(5)} is the default.
{phang}
{opt dfdefault(#)} determines the default maximum degrees of
freedom (df) for a predictor. The default is {cmd:dfdefault(4)} (second
degree FP).
{phang}
{opt adjust(adj_list)}
defines the adjustment for the covariates {it:xvar1}, {it:xvar2}, ..., of
{it:xvarlist}. The default is {cmd:adjust(mean)}, except for binary
covariates, where it is {opt adjust(#)}, with {it:#} being the lower
of the two distinct values of the covariate.
A typical item in {it:adj_list} is
{it:varlist}{cmd::}{c -(}{opt mean}|{it:#}|{opt no}{c )-}.
Items are separated by commas. The first item is special in that
{it:varlist} is optional, and, if it is omitted, the default is reset to
the specified value ({opt mean}, {it:#}, or {opt no}). For example,
{cmd:adjust(no, age:mean)} sets the default to {opt no} (i.e., no
adjustment) and the adjustment for {opt age} to {opt mean}.
{phang}
{opt alpha(alpha_list)}
sets the significance levels for testing between FP models
of different degree. The rules for {it:alpha_list} are the same as for
{it:df_list} in the {helpb mfp##df:df()} option.
The default nominal p-value (significance level, selection level) is 0.05
for all variables.
{pmore}
Example: {cmd:alpha(0.01)} specifies that all variables have an FP
selection level of 1 percent.
{pmore}
Example: {cmd:alpha(0.05, weight:0.1)} specifies that all variables
except {opt weight} have FP selection level 5 percent; {opt weight}
has level 10 percent.
{phang}{marker df}
{opt df(df_list)}
sets the degrees of freedom (df) for each predictor. The df (not
counting the regression constant, {cmd:_cons}) are twice the degree of the
FP, so, for example, an {it:xvar} fitted as a second-degree FP (FP2) has 4
df. The first item in {it:df_list} may be either {it:#} or
{varlist}{cmd::}{it:#}. Subsequent items must be
{it:varlist}{cmd::}{it:#}. Items are separated by commas, and
{it:varlist} is specified in the usual way for variables. With the first
type of item, the df for all predictors are taken to be {it:#}. With the
second type of item, all members of {it:varlist} (which must be a subset
of {it:xvarlist}) have {it:#} df.
{pmore}
The default number of degrees of freedom for a predictor of type
{it:varlist} specified in {it:xvarlist} but not in {it:df_list} is
assigned according to the number of distinct (unique) values of the
predictor, as follows:
{hline 43}
# of distinct values default df
{hline 43}
1 (invalid predictor)
2-3 1
4-5 min(2, {opt dfdefault()})
{ul:>}6 {opt dfdefault()}
{hline 43}
{pmore}
Example: {cmd:df(4)}{break}
All variables have 4 df.
{pmore}
Example: {cmd:df(2, weight displ:4)}{break}
{opt weight} and {opt displ} have 4 df; all other variables have 2 df.
{pmore}
Example: {cmd:df(weight displ:4, mpg:2)}{break}
{opt weight} and {opt displ} have 4 df, {opt mpg} has 2 df, all other
variables have default df.
{phang}{marker powers}
{opth powers(numlist)} is the set of fractional polynomial powers to
be used. The default set is -2,-1,-0.5,0,0.5,1,2,3 (0 means log).
{dlgtab:Adv. model}
{phang}
{cmd:xorder(+}|{cmd:-}|{cmd:n)}
determines the order of entry of the covariates into the model selection
algorithm. The default is {cmd:xorder(+)}, which enters them in decreasing
order of significance in a multiple linear regression (most significant
first). {cmd:xorder(-)} places them in reverse significance order, whereas
{cmd:xorder(n)} respects the original order in {it:xvarlist}.
{phang}
{opt select(select_list)}
sets the nominal p-values (significance levels) for variable selection by
backward elimination. A variable is dropped if its removal causes a
nonsignificant increase in deviance. The rules for {it:select_list} are
the same as those for {it:df_list} in the {helpb mfp##df:df()} option.
Using the default selection level of 1 for all variables forces them all
into the model. Setting the nominal p-value to be 1 for a given variable
forces it into the model, leaving others to be selected or not. The
nominal p-value for elements of {it:xvarlist} bound by parentheses is
specified by including {opt (varlist)} in {it:select_list}.
{pmore}
Example: {cmd:select(0.05)}{break}
All variables have a nominal p-value of 5 percent.
{pmore}
Example: {cmd:select(0.05, weight:1)}{break}
All variables except {opt weight} have a nominal p-value of 5 percent;
{opt weight} is forced into the model.
{pmore}
Example: {cmd:select(a (b c):0.05)}{break}
All variables except {opt a}, {opt b}, and {opt c} are forced into the
model. {opt b} and {opt c} are tested jointly with 2 df at the 5-percent
level, and {opt a} is tested singly at the 5-percent level.
{phang}
{opt xpowers(xp_list)}
sets the permitted fractional polynomial powers for covariates
individually. The rules for {it:xp_list} are the same as for {it:df_list}
in the {helpb mfp##df:df()} option. The default selection is the same as
those for the {helpb mfp##powers:powers()} option.
{pmore}
Example: {cmd:xpowers(-1 0 1)}{break}
All variables have powers -1,0,1.
{pmore}
Example: {cmd:xpowers(x5:-1 0 1)}{break}
All variables except {cmd:x5} have default powers; {cmd:x5} has powers -1,0,1.
{phang}
{opth zero(varlist)}
treats negative and zero values of members of {it:varlist} as zero
when FP transformations are applied. By default, such variables are
subjected to a preliminary linear transformation to avoid negative and zero
values (see {helpb fracpoly}). {it:varlist} must be part of
{it:xvarlist}.
{phang}
{opth catzero(varlist)}
is a variation on {opt zero()}. {it:varlist} must be part of
{it:xvarlist}.
{phang}
{it:regression_cmd_options} may be any of the options appropriate to
{it:{help mfp##syntax:regression_cmd}}.
{title:Remarks}
{pstd}
For elements in {it:xvarlist} not enclosed in parentheses, {cmd:mfp} leaves
variables in the data named {cmd:I}{it:xvar}{cmd:_1},
{cmd:I}{it:xvar}{cmd:_2}, ... where {it:xvar} represents the first four
letters of the name of {it:xvar1}, and so on for {it:xvar2}, {it:xvar3}, etc.
The new variables contain the best-fitting fractional polynomial powers of
{it:xvar1}, {it:xvar2}, ...
{title:Examples}
{phang}
{cmd:. mfp regress mpg weight displacement foreign}
{phang}
{cmd:. mfp regress mpg weight displacement foreign, df(1, weight displ:4)}
{phang}
{cmd:. mfp regress mpg weight displacement foreign, df(2, foreign:1)}
{cmd:select(0.05, foreign:1)}
{phang}
{cmd:. xi: mfp regress mpg weight displacement foreign (i.rep78), dfdefault(2)}
{cmd:select(0.05, foreign:1, (i.rep78):0.2)}
{phang}
{cmd:. xi: mfp regress mpg weight displacement foreign (i.rep78), dfdefault(2)}
{cmd:aic}
{phang}
{cmd:. fracplot displacement}
{title:Also see}
{psee}
Manual: {bf:[R] mfp}
{psee}
Online: {help mfp postestimation};{break}
{helpb fracpoly}
{p_end}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -