selectiveInference (version 1.2.5)

factorDesign: Expand a data frame with factors to form a design matrix with the full binary encoding of each factor.

Description

When using groupfs with factor variables call this function first to create a design matrix.

Usage

factorDesign(df)

Arguments

df

Data frame containing some columns which are factors.

Value

List containing

x

Design matrix, the first columns contain any numeric variables from the original date frame.

index

Group membership indicator for expanded matrix.

Examples

Run this code
# NOT RUN {
fd = factorDesign(warpbreaks)
y = rnorm(nrow(fd$x))
fit = groupfs(fd$x, y, fd$index, maxsteps=2, intercept=F)
pvals = groupfsInf(fit)
# }

Run the code above in your browser using DataLab