Learn R Programming

Gifi (version 0.4-0)

knotsGifi: Utility function for Gifi knot specifications.

Description

Produces a list of knots used as input argument in various Gifi functions (homals, princals, morals, etc.). Contains options for placing knots at the quantiles, for knots equally spaced on the range, for knots at the data points, and for no interior knots.

Usage

knotsGifi(x, type = c("Q", "R", "E", "D"), n = 3)

Value

A list containing knots for each variable.

Arguments

x

Data frame

type

"Q" for knots at the quantiles, "R" for equally spaced knots, "E" for no interior knots, "D" for knots at the data points

n

Number of interior knots (ignored for type = "E" and type = "D")

Details

Simple linear or polynomial transformations can be specified using type = "E" and the corresponding degree in the subsequent Gifi function call. If the data frame contains factors, they are converted internally to numeric using makeNumeric.

Examples

Run this code
ABC6 <- ABC[,6:11]
knotsGifi(ABC6, "Q")      ## tercile knots
knotsGifi(ABC6, "Q", 4)   ## quartile knots
knotsGifi(ABC6, "R")      ## 3 equally spaced interior knots
knotsGifi(ABC6, "E")      ## no interior knots
knotsGifi(ABC6, "D")      ## knots at the data points

Run the code above in your browser using DataLab