factorDesign {selectiveInference}R Documentation

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

## Not run: 
fd = factorDesign(warpbreaks)
y = rnorm(nrow(fd$x))
fit = groupfs(fd$x, y, fd$index, maxsteps=2, intercept=F)
pvals = groupfsInf(fit)

## End(Not run)

[Package selectiveInference version 1.2.5 Index]