**[R] fp postestimation** -- Postestimation tools for fp

__Postestimation commands__

The following postestimation commands are of special interest after **fp**:

Command Description
-------------------------------------------------------------------------
**fp plot** component-plus-residual plot from most recently fit
fractional polynomial model
**fp predict** create variable containing prediction or SEs of
fractional polynomials
-------------------------------------------------------------------------

The following standard postestimation commands are also available if
available after* est_cmd*:

Command Description
-------------------------------------------------------------------------
**contrast** contrasts and ANOVA-style joint tests of estimates
**estat ic** Akaike's and Schwarz's Bayesian information criteria
(AIC and BIC)
**estat summarize** summary statistics for the estimation sample
**estat vce** variance-covariance matrix of the estimators (VCE)
**estimates** cataloging estimation results
**forecast** dynamic forecasts and simulations
**hausman** Hausman's specification test
**lincom** point estimates, standard errors, testing, and
inference for linear combinations of coefficients
**linktest** link test for model specification
**lrtest** likelihood-ratio test
**margins** marginal means, predictive margins, marginal effects,
and average marginal effects
**marginsplot** graph the results from margins (profile plots,
interaction plots, etc.)
**nlcom** point estimates, standard errors, testing, and
inference for nonlinear combinations of coefficients
**predict** predictions, residuals, influence statistics, and
other diagnostic measures
**predictnl** point estimates, standard errors, testing, and
inference for generalized predictions
**pwcompare** pairwise comparisons of estimates
**suest** seemingly unrelated estimation
**test** Wald tests of simple and composite linear hypotheses
**testnl** Wald tests of nonlinear hypotheses
-------------------------------------------------------------------------

__predict__

The behavior of **predict** following **fp** is determined by *est_cmd*. See the
corresponding *est_cmd* postestimation entry for available **predict** options.

Also see information on **fp predict** below.

__margins__

The behavior of **margins** following **fp** is determined by *est_cmd*. See the
corresponding *est_cmd* postestimation entry for available **margins** options.

__Syntax for fp plot and fp predict__

Component-plus-residual plot for most recently fit fractional polynomial
model

**fp** **plot** [*if*] [*in*]**,** __r__**esiduals(***res_option***)** [*graph_options*]

Create variable containing the prediction or SEs of fractional
polynomials

**fp** **predict** [*type*] *newvar* [*if*] [*in*] [**,** *predict_options*]

*graph_options* Description
-------------------------------------------------------------------------
Main
* __r__**esiduals(***res_option***)** residual option name to use in **predict**
after *est_cmd*, or **residuals(none)** if
residuals are not to be graphed
__eq__**uation(***eqno***)** specify equation
__l__**evel(***#***)** set confidence level; default is **level(95)**

Plot
__plotop__**ts(***scatter_options***)** affect rendition of the
component-plus-residual scatter points

Fitted line
__lineop__**ts(***cline_options***)** affect rendition of the fitted line

CI plot
__ciop__**ts(***area_options***)** affect rendition of the confidence bands

Add plots
**addplot(***plot***)** add other plots to the generated graph

Y axis, X axis, Titles, Legend, Overall
*twoway_options* any options other than **by()** documented in
**[G-3]** *twoway_options*
-------------------------------------------------------------------------
* **residuals(***res_option***)** is required.

*predict_options* Description
-------------------------------------------------------------------------
Main
**fp** calculate the fractional polynomial; the default
**stdp** calculate the standard error of the fractional
polynomial
__eq__**uation(***eqno***)** specify equation
-------------------------------------------------------------------------

__Menu for fp plot and fp predict__

__fp plot__

**Statistics > Linear models and related > Fractional polynomials >**
**Component-plus-residual plot**

__fp predict__

**Statistics > Linear models and related > Fractional polynomials >**
**Fractional polynomial prediction**

__Description for fp plot and fp predict__

**fp plot** produces a component-plus-residual plot. The fractional
polynomial comprises the component, and the residual is specified by the
user in **residuals()**. The component-plus-residuals are plotted against
the fractional polynomial variable. If you only want to plot the
component fit, without residuals, you would specify **residuals(none)**.

**fp predict** generates the fractional polynomial or the standard error of
the fractional polynomial. The fractional polynomial prediction is
equivalent to the fitted values prediction given by **predict, xb**, with the
covariates other than the fractional polynomial variable set to zero. The
standard error may be quite large if the range of the other covariates is
far from zero. In this situation, the covariates would be centered and
their range would include, or come close to including, zero.

These postestimation commands can be used only when the fractional
polynomial variables do not interact with other variables in the
specification of *est_cmd*. See fvvarlist for more information about
interactions.

__Options for fp plot__

+------+
----+ Main +-------------------------------------------------------------

**residuals(***res_option***)** specifies what type of residuals to plot in the
component-plus-residual plot. *res_option* is the same option that
would be specified to **predict** after *est_cmd*. Residuals can be
omitted from the plot by specifying **residuals(none)**. **residuals()** is
required.

**equation(***eqno***)** is relevant only when you have previously fit a
multiple-equation model in *est_cmd*. It specifies the equation to
which you are referring.

**equation(#1)** would mean that the calculation is to be made for the
first equation, **equation(#2)** would mean the second, and so on. You
could also refer to the equations by their names: **equation(income)**
would refer to the equation name **income**, and **equation(hours)** would
refer to the equation named **hours**.

If you do not specify **equation()**, the results are the same as if you
specified **equation(#1)**.

**level(***#***)**; see **[R] estimation options**.

+------+
----+ Plot +-------------------------------------------------------------

**plotopts(***scatter_options***)** affects the rendition of the
component-plus-residual scatter points; see **[G-2] graph twoway**
**scatter**.

+-------------+
----+ Fitted line +------------------------------------------------------

**lineopts(***cline_options***)** affects the rendition of the fitted line; see
**[G-3]** *cline_options*.

+---------+
----+ CI plot +----------------------------------------------------------

**ciopts(***area_options***)** affects the rendition of the confidence bands; see
**[G-3]** *area_options*.

+-----------+
----+ Add plots +--------------------------------------------------------

**addplot(***plot***)** provides a way to add other plots to the generated graph.
See **[G-3]** *addplot_option*.

+-----------------------------------------+
----+ Y axis, X axis, Titles, Legend, Overall +--------------------------

*twoway_options* are any of the options documented in **[G-3]** *twoway_options*,
excluding **by()**. These include options for titling the graph (see
**[G-3]** *title_options*) and for saving the graph to disk (see **[G-3]**
*saving_option*).

__Options for fp predict__

+------+
----+ Main +-------------------------------------------------------------

**fp** calculates the fractional polynomial, the linear prediction with other
variables set to zero. This is the default.

**stdp** calculates the standard error of the fractional polynomial.

**equation(***eqno***)** is relevant only when you have previously fit a
multiple-equation model in *est_cmd*. It specifies the equation to
which you are referring.

**equation(#1)** would mean that the calculation is to be made for the
first equation, **equation(#2)** would mean the second, and so on. You
could also refer to the equations by their names: **equation(income)**
would refer to the equation name **income**, and **equation(hours)** would
refer to the equation named **hours**.

If you do not specify **equation()**, the results are the same as if you
specified **equation(#1)**.

__Examples__

Setup
**. webuse igg**

Fit the optimal second-degree fractional polynomial regression model
**. fp <age>: regress sqrtigg <age>**

Produce a component-plus-residual plot to evaluate the fit of the model
**. fp plot, r(residuals)**

Predict the standard errors of the fractional polynomial
**. fp predict se, stdp**