weight_design: Create design matrices with different weights

View source: R/weight_design.R

weight_designR Documentation

Create design matrices with different weights

Description

Creates all the possible matrices given a number of blocks and a number of weights. Optionally it can create just a subset of those based on a numeric vector.

Usage

weight_design(weights = 4, size, diff0 = NULL)

Arguments

weights

A numeric value with the number of weights to be used

size

A numeric value with the number of datasets on the design.

diff0

A Numeric vector of position which should be different from 0 from the lower.tri(). See examples

Value

A list of matrices with the designs with different weights.

Author(s)

Flodel: https://codereview.stackexchange.com/a/203517/36067

See Also

subSymm()

Examples

out <- weight_design(4, 4)
head(out)
# Using previously defined matrix
C <- diag(4)
diag(C) <- 0
C <- subSymm(C, 1, 2, 0.456)
C <- subSymm(C, 2, 3, runif(1))
C <- subSymm(C, 1, 3, runif(1))
C <- subSymm(C, 3, 4, runif(1))
# Explore matrices which are similar to C
d <- weight_design(weights = 11, size = 4, which(lower.tri(C) & C != 0))
head(d)

llrs/inteRmodel documentation built on April 1, 2022, 4:04 p.m.