knotsGifi: Utility function for Gifi knot specifications.

View source: R/knotsGifi.R

knotsGifiR Documentation

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)

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.

Value

A list containing knots for each variable.

Examples

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

Gifi documentation built on Oct. 4, 2022, 1:06 a.m.

Related to knotsGifi in Gifi...