Learn R Programming

mfp (version 1.4.6)

plot.mfp: Plots for mfp objects

Description

This function draws two plots: (i) the linear predictor function and (ii) partial residuals together with a lowess smooth. For Cox models also smoothed martingale based residuals of the null model are plotted against the predictor.

Usage

## S3 method for class 'mfp':
plot(x, var=NULL, ref.zero=TRUE, ask=TRUE, ...)

Arguments

x
object representing a fitted mfp model.
var
the variable for which plots are desired. By default, plots are produced in turn for each variable of a model.
ref.zero
subtract a constant from X beta before plotting so that the reference value of the 'x'-variable yields 'y=0'.
ask
logical; if 'TRUE', the user is asked before each plot, see 'par(ask=.)'.
...
further arguments.

Value

    Examples

    Run this code
    data(GBSG)
    	f <- mfp(Surv(rfst, cens) ~ fp(age, df = 4, select = 0.05)
                     + fp(prm, df = 4, select = 0.05), family = cox, data = GBSG)
    	par(mfrow=c(2,2), mar=c(4,4,1,1), mgp=c(1.5,0.75,0))
          plot(f, var="age")

    Run the code above in your browser using DataLab