ערוך

שתף באמצעות


rxStepPlot: Step Plot

Description

Plot stepwise coefficients for rxLinMod, rxLogit and rxGlm objects.

Usage

  rxStepPlot(x, plotStepBreaks = TRUE, omitZeroCoefs = TRUE, eps = .Machine$double.eps, 
    main = deparse(substitute(x)), xlab = "Step", ylab = "Stepwise Coefficients", 
    type = "b", pch = "*",
      ...  )

Arguments

x

a stepwise regression object of class rxLinMod, rxLogit, or rxGlmwith a non-empty stepCoefs component, which can be generated by setting the component keepStepCoefs of the variableSelection argument to TRUE when the model is fitted.

plotStepBreaks

logical value. If TRUE, vertical lines are drawn at each step in the stepwise coefficient paths.

omitZeroCoefs

logical flag. If TRUE, coefficients with sum of absolute values less than eps will be omitted for plotting.

eps

the smallest positive floating-point number that is treated as nonzero.

main, xlab, ylab, type, pch, ...

additional graphical arguments to be passed directly to the underlying matplot function.

Value

the nonzero stepwise coefficients are returned invisibly.

Author(s)

Microsoft Corporation Microsoft Technical Support

See Also

rxStepControl, rxLinMod, rxLogit, rxGlm.

Examples


 ## setup
 form <- Sepal.Length ~ Sepal.Width + Petal.Length
 scope <- list(
     lower = ~ Sepal.Width,
     upper = ~ Sepal.Width + Petal.Length + Petal.Width * Species)

 ## rxLinMod/variableSelection with keepStepCoefs = TRUE
 varsel <- rxStepControl(method = "stepwise", scope = scope, keepStepCoefs = TRUE)
 rxlm.step <- rxLinMod(form, data = iris, variableSelection = varsel,
     verbose = 1, dropMain = FALSE, coefLabelStyle = "R")
 rxStepPlot(rxlm.step)