designs_fractioning: Fractioning transformation to binary format

View source: R/designs_fractioning.R

designs_fractioningR Documentation

Fractioning transformation to binary format

Description

Transform the experimental design based on factors. The initial design configuration assumes that all alternatives' attributes are "factors": vectors declared using 'c()' assignement. Other attribute types are ignored. However, such definition allows for multilevel and ordered factors specifications. This function transforms multilevel factors to the completely binary version.

Usage

designs_fractioning(Z)

Arguments

Z

Input factorail matrix as returned by the designs_f function.

Value

data.frame A dataset of choice sets (Z) respecting the transformation rules.

Examples

# Create alternatives
alt1 <- alternative$new()
alt1$add_attributes(Quality = c(0:1), Price = c(2, 2.5))
alt2 <- alternative$new()
alt2$add_attributes(Size = c(1:3), Price = c(1.5, 2))

# Regroup alternatives into design
edesign <- experimental_design$new(alternatives = list(alt1, alt2), design = "factorial")
Z <- designs_f(edesign, n = 3)
designs_fractioning(Z)

nikitagusarov/dcesimulatr documentation built on Jan. 7, 2023, 4:27 p.m.