Package {SCCDdesign}


Title: Construction of Screening Designs for Mixed Level Continuous and Categorical Factors
Version: 0.2.0
Description: Constructs screening designs for experiments involving continuous and categorical factors with multiple levels. The package implements methods for constructing mixed-level screening designs, involving factors with more than two levels. It also evaluates the statistical performance of screening designs throughdev power to identify active effects and Type I error rates. The package implements three methods proposed by Jones, B., Lekivetz, R., Majumdar, D. and Nachtsheim, C. (2025) <doi:10.1080/00401706.2024.2362149> for generating efficient screening designs involving three-level continuous and two-level categorical factors for even run sizes. It also includes Paley Type I and Type II constructions for conference matrices and pseudo conference matrices obtained using the coordinate exchange algorithm by Jones, B. and Nachtsheim, C. J. (2011) <doi:10.1080/00224065.2011.11917841> which are used in the development of these screening designs.
License: GPL-3
Encoding: UTF-8
RoxygenNote: 8.0.0
Imports: pracma, AlgDesign, leaps, stats
NeedsCompilation: no
Packaged: 2026-09-20 10:20:51 UTC; VYSHNA
Author: Vyshna I C [aut, cre], Cini Varghese [aut, ctb], Safeela Nasrin [aut], Boyina Devi Priyanka [aut, ctb], Mohd Harun [aut, ctb], Anindita Datta [aut, ctb]
Maintainer: Vyshna I C <vyshnaic@gmail.com>
Repository: CRAN
Date/Publication: 2026-09-21 10:00:41 UTC

Constructs an SCCD for a specified number of runs (n=2m). The construction method is selected automatically according to the number of runs.

Description

Constructs an SCCD for a specified number of runs (n=2m). The construction method is selected automatically according to the number of runs.

Usage

SCCD(n)

Arguments

n

A positive even integer specifying the number of runs.

Details

Method I is used when n is divisible by 8. Method II is used when n is divisible by 4 but not by 8. Method III is used when n is even but not divisible by 4.

Value

A numeric SCCD matrix containing m continuous and m-1 categorical factors.

Examples

SCCD(16)

Construct Saturated screening designs for continous and categorical factor (SCCD) Using Method I Constructs an SCCD when the number of runs (n=2m) is divisible by 8, using a conference matrix and a Hadamard matrix. The number of continuous factor is m and the number of categorical factors is m-1)

Description

Construct Saturated screening designs for continous and categorical factor (SCCD) Using Method I Constructs an SCCD when the number of runs (n=2m) is divisible by 8, using a conference matrix and a Hadamard matrix. The number of continuous factor is m and the number of categorical factors is m-1)

Usage

SCCD_method1(n)

Arguments

n

A positive integer specifying the number of runs.

Value

A numeric SCCD matrix.


Construct SCCD Using Method II Constructs an SCCD when the number of runs (n=2m) is divisible by 4 but not divisible by 8, using a conference matrix and a D-optimal two-level design. The number of continuous factor is m and number of categorical factors is m-1

Description

Construct SCCD Using Method II Constructs an SCCD when the number of runs (n=2m) is divisible by 4 but not divisible by 8, using a conference matrix and a D-optimal two-level design. The number of continuous factor is m and number of categorical factors is m-1

Usage

SCCD_method2(n)

Arguments

n

A positive integer specifying the number of runs.

Value

A numeric SCCD matrix.


Construct SCCD Using Method III Constructs an SCCD when the number of runs (n=2m) is even but not divisible by 4, using a pseudo-conference matrix and a D-optimal two-level design. The number of continuous factor is m and the number of categorical factors is m-1)

Description

Construct SCCD Using Method III Constructs an SCCD when the number of runs (n=2m) is even but not divisible by 4, using a pseudo-conference matrix and a D-optimal two-level design. The number of continuous factor is m and the number of categorical factors is m-1)

Usage

SCCD_method3(n, starts = 1000, max.iter = 100)

Arguments

n

A positive integer specifying the number of runs.

starts

Number of random starting matrices used in the pseudo-conference matrix search. Default is 1000.

max.iter

Maximum number of iterations for each starting matrix. Default is 100.

Value

A numeric SCCD matrix.


Constructs a conference matrix of a specified order using a direct construction for order 2 and Paley-based constructions for supported odd prime or prime-power values of q = n - 1.

Description

Constructs a conference matrix of a specified order using a direct construction for order 2 and Paley-based constructions for supported odd prime or prime-power values of q = n - 1.

Usage

conferenceMatrix(n)

Arguments

n

A single finite integer specifying the order of the conference matrix. The value must be at least 2.

Details

For n = 2, the conference matrix is constructed directly. For larger orders, the function sets q = n - 1 and determines whether q is a supported odd prime or odd prime power. Depending on the value of q modulo 4, the corresponding Paley construction is used. An error is returned when the supplied order does not satisfy the requirements of the implemented construction.

Value

A numeric n \times n conference matrix.

Examples

conferenceMatrix(6)

Constructs a D-optimal two-level design with m runs and m - 1 factors. The factor levels are coded as -1 and +1.

Description

Constructs a D-optimal two-level design with m runs and m - 1 factors. The factor levels are coded as -1 and +1.

Usage

dOptimalTwoLevel(m)

Arguments

m

A positive integer specifying the number of runs. The minimum value is 3.

Details

The candidate set is generated using all possible combinations of -1 and +1 for the factors. The D-optimal design is selected using AlgDesign::optFederov().

Value

A numeric matrix containing the D-optimal two-level design.

Examples

dOptimalTwoLevel(4)
dOptimalTwoLevel(8)

Constructs an orthogonal design for two types of even-level factors using a Hadamard matrix. The first column of the Hadamard matrix is removed, and scaled copies of the resulting matrix are combined to obtain the required factor levels.

Description

Constructs an orthogonal design for two types of even-level factors using a Hadamard matrix. The first column of the Hadamard matrix is removed, and scaled copies of the resulting matrix are combined to obtain the required factor levels.

Usage

even_even_design(a, b, m)

Arguments

a

Number of levels for the first factor. Must be even.

b

Number of levels for the second factor. Must be even.

m

Order of the Hadamard matrix.Must be a multiple of 4. The constructed design contains m - 1 factors of each of the two factor types.

Value

A matrix containing the constructed design. The first m - 1 columns correspond to the first type factor, and the remaining m - 1 columns correspond to the second type factor.


Generate Elements of a Finite Field Generates the coefficient-vector representations of all elements of GF(p^m).

Description

Generate Elements of a Finite Field Generates the coefficient-vector representations of all elements of GF(p^m).

Usage

generateGF(p, m)

Arguments

p

A prime number.

m

A positive integer specifying the field extension degree.

Value

A matrix containing all elements of GF(p^m).


Finite-Field Addition Adds two finite-field elements componentwise modulo p.

Description

Finite-Field Addition Adds two finite-field elements componentwise modulo p.

Usage

gfAdd(a, b, p)

Arguments

a

A finite-field element.

b

A finite-field element.

p

A prime number.

Value

The sum of the two elements modulo p.


Finite-Field Multiplication Multiplies two elements of GF(p^m) using polynomial multiplication and reduction.

Description

Finite-Field Multiplication Multiplies two elements of GF(p^m) using polynomial multiplication and reduction.

Usage

gfMultiply(a, b, p, modulus)

Arguments

a

A finite-field element.

b

A finite-field element.

p

A prime number.

modulus

The irreducible polynomial used to define the field.

Value

The product of the two finite-field elements.


Finite-Field Subtractio Subtracts two finite-field elements componentwise modulo p.

Description

Finite-Field Subtractio Subtracts two finite-field elements componentwise modulo p.

Usage

gfSubtract(a, b, p)

Arguments

a

A finite-field element.

b

A finite-field element.

p

A prime number.

Value

The difference of the two elements modulo p.


Constructs a Hadamard matrix of order n using pracma::hadamard().

Description

Constructs a Hadamard matrix of order n using pracma::hadamard().

Usage

hadamardMatrix(n)

Arguments

n

A positive integer specifying the order of the matrix.

Details

A Hadamard matrix contains only +1 and -1, and its rows are mutually orthogonal. The supported orders are of the forms 2^e, 12(2^e), and 20(2^e).

Value

A Hadamard matrix of order n.

Examples

hadamardMatrix(4)
hadamardMatrix(8)
hadamardMatrix(12)

Convert an Integer to a Finite-Field Element Converts an integer to its coefficient-vector representation in GF(p^m).

Description

Convert an Integer to a Finite-Field Element Converts an integer to its coefficient-vector representation in GF(p^m).

Usage

intToGF(x, p, m)

Arguments

x

A non-negative integer.

p

A prime number.

m

A positive integer specifying the field extension degree.

Value

An integer vector representing an element of GF(p^m).


Irreducible Polynomial Returns a predefined irreducible polynomial used for constructing the finite field GF(p^m).

Description

Irreducible Polynomial Returns a predefined irreducible polynomial used for constructing the finite field GF(p^m).

Usage

irreduciblePolynomial(p, m)

Arguments

p

A prime number.

m

A positive integer specifying the field extension degree.

Value

A numeric vector containing the polynomial coefficients.


Check for a Prime Number. Checks whether a given number is prime.

Description

Check for a Prime Number. Checks whether a given number is prime.

Usage

is_prime(q)

Arguments

q

A numeric value to be checked.

Value

TRUE if q is prime and FALSE otherwise.


Check for a Prime Power. Checks whether q is a prime or a power of a prime number.

Description

Check for a Prime Power. Checks whether q is a prime or a power of a prime number.

Usage

is_prime_power(q)

Arguments

q

A positive integer to be checked.

Value

TRUE if q is a prime or prime power and FALSE otherwise.


Jacobsthal Matrix for a Prime Constructs a Jacobsthal matrix when q is prime using the quadratic character modulo q.

Description

Jacobsthal Matrix for a Prime Constructs a Jacobsthal matrix when q is prime using the quadratic character modulo q.

Usage

jacobsthalPrime(q)

Arguments

q

A prime number specifying the order of the Jacobsthal matrix.

Value

A numeric Jacobsthal matrix of order q.


Jacobsthal Matrix for a Prime Power Constructs a Jacobsthal matrix over the finite field GF(p^m) when q = p^m is an odd prime power.

Description

Jacobsthal Matrix for a Prime Power Constructs a Jacobsthal matrix over the finite field GF(p^m) when q = p^m is an odd prime power.

Usage

jacobsthalPrimePower(q)

Arguments

q

An odd prime power specifying the order of the Jacobsthal matrix.

Value

A numeric Jacobsthal matrix of order q.


Constructs an orthogonal design for two types of factors with different numbers of levels. Three construction cases are considered: even-even level factors, odd-even level factors and odd-odd level factors. The appropriate construction is selected automatically according to the parity of the numbers of levels of the two factors. Hadamard matrices are used for even-level factors, while conference matrices are used for odd-level factors. The order of both the Hadamard and conference matrices is m. For the even-even case, the design contains m - 1 factors of each type. For the odd-even case, the design contains m odd-level factors and m - 1 even-level factors. For the odd-odd case, the design contains m factors of each type.

Description

Constructs an orthogonal design for two types of factors with different numbers of levels. Three construction cases are considered: even-even level factors, odd-even level factors and odd-odd level factors. The appropriate construction is selected automatically according to the parity of the numbers of levels of the two factors. Hadamard matrices are used for even-level factors, while conference matrices are used for odd-level factors. The order of both the Hadamard and conference matrices is m. For the even-even case, the design contains m - 1 factors of each type. For the odd-even case, the design contains m odd-level factors and m - 1 even-level factors. For the odd-odd case, the design contains m factors of each type.

Usage

mixed_level_design(a, b, m)

Arguments

a

Number of levels of the first factor.

b

Number of levels of the second factor.

m

Order of the Hadamard and conference matrices used in the construction. Must be a multiple of 4.

Value

A matrix containing the constructed orthogonal design. The total number of factors depends on the construction case: 2(m - 1) for the even-even case, ⁠2m - 1⁠ for the odd-even case, and ⁠2m⁠ for the odd-odd case.

Examples

mixed_level_design(a = 4, b = 2, m = 4)
mixed_level_design(a = 3, b = 2, m = 8)
mixed_level_design(a = 5, b = 3, m = 4)

Constructs an orthogonal design for an odd-level factor and an even-level factor using a conference matrix and a Hadamard matrix, respectively.

Description

Constructs an orthogonal design for an odd-level factor and an even-level factor using a conference matrix and a Hadamard matrix, respectively.

Usage

odd_even_design(a, b, m)

Arguments

a

Number of levels for the odd-level factor.

b

Number of levels for the even-level factor.

m

Order of the conference and Hadamard matrices. Must be a multiple of 4.The design containsm factors of the odd-level type and m - 1 factors of the even-level type.

Value

A matrix containing the constructed design. The first m columns correspond to the odd-level factors and are constructed using a conference matrix, while the remaining m - 1 columns correspond to the even-level factors and are constructed using a Hadamard matrix with its first column removed.


Constructs an orthogonal design for two types of odd-level factors using conference matrices.

Description

Constructs an orthogonal design for two types of odd-level factors using conference matrices.

Usage

odd_odd_design(a, b, m)

Arguments

a

Number of levels for the first odd-level factor.

b

Number of levels for the second odd-level factor.

m

Order of the conference matrix. Must be a multiple of 4.The design contains m factors of the first odd-level type and m factors of the second odd-level type.

Value

A matrix containing the constructed design. The first m columns correspond to the first odd-level factor and the remaining m columns correspond to the second odd-level factor. Both sets of columns are constructed using a conference matrix.


Paley Conference Matrix for a Prime Constructs a Paley conference matrix of order n when q = n - 1 is an odd prime.

Description

Paley Conference Matrix for a Prime Constructs a Paley conference matrix of order n when q = n - 1 is an odd prime.

Usage

paleyPrime(n)

Arguments

n

A positive integer specifying the order of the conference matrix.

Value

A numeric conference matrix of order n.


Paley Conference Matrix for a Prime Power Constructs a Paley conference matrix of order n when q = n - 1 is an odd prime power.

Description

Paley Conference Matrix for a Prime Power Constructs a Paley conference matrix of order n when q = n - 1 is an odd prime power.

Usage

paleyPrimePower(n)

Arguments

n

A positive integer specifying the order of the conference matrix.

Value

A numeric conference matrix of order n.


Polynomial Multiplication over GF(p Multiplies two polynomials with coefficients in GF(p).

Description

Polynomial Multiplication over GF(p Multiplies two polynomials with coefficients in GF(p).

Usage

polyMultiply(a, b, p)

Arguments

a

A vector containing the coefficients of the first polynomial.

b

A vector containing the coefficients of the second polynomial.

p

A prime number.

Value

A vector containing the coefficients of the product modulo p.


Polynomial Reduction over GF(p) Reduces a polynomial modulo a specified irreducible polynomial over GF(p).

Description

Polynomial Reduction over GF(p) Reduces a polynomial modulo a specified irreducible polynomial over GF(p).

Usage

polyReduce(poly, modulus, p)

Arguments

poly

A vector containing polynomial coefficients.

modulus

A vector containing the coefficients of the irreducible polynomial.

p

A prime number.

Value

The reduced polynomial as a coefficient vector.


Identify a Prime Power Determines whether q can be expressed as p^m, where p is a prime number and m is a positive integer.

Description

Identify a Prime Power Determines whether q can be expressed as p^m, where p is a prime number and m is a positive integer.

Usage

primePowerInfo(q)

Arguments

q

A positive integer to be checked.

Value

A list containing p and m if q is a prime or prime power; otherwise NULL.


Constructs a pseudo-conference matrix of order n using a determinant-based search procedure.

Description

Constructs a pseudo-conference matrix of order n using a determinant-based search procedure.

Usage

pseudoConference(n, starts = 1000, max.iter = 100)

Arguments

n

A positive integer specifying the order of the matrix.

starts

Number of random starting matrices used in the search. Default is 1000.

max.iter

Maximum number of iterations for each starting matrix. Default is 100.

Details

The matrix has zero diagonal elements and off-diagonal elements equal to -1 or +1. The search selects a matrix by maximizing the determinant criterion.

Value

A list containing the pseudo-conference matrix and the corresponding log-determinant value.

Examples

result <- pseudoConference(6, starts = 10, max.iter = 10)
result$Matrix
result$LogDet

Quadratic Character in a Finite Field Computes the quadratic character of an element of GF(p^m). It returns 0 for the zero element, 1 for a nonzero quadratic residue, and -1 otherwise.

Description

Quadratic Character in a Finite Field Computes the quadratic character of an element of GF(p^m). It returns 0 for the zero element, 1 for a nonzero quadratic residue, and -1 otherwise.

Usage

quadraticCharacterGF(x, QR)

Arguments

x

A finite-field element.

QR

A matrix containing the nonzero quadratic residues of the finite field.

Value

The quadratic character: 0, 1, or -1.


Quadratic Character Modulo a Prime Computes the quadratic character of an integer modulo a prime. It returns 0 for zero, 1 for a quadratic residue, and -1 otherwise.

Description

Quadratic Character Modulo a Prime Computes the quadratic character of an integer modulo a prime. It returns 0 for zero, 1 for a quadratic residue, and -1 otherwise.

Usage

quadraticCharacterPrime(x, q, QR)

Arguments

x

An integer.

q

A prime number.

QR

A vector containing the nonzero quadratic residues modulo q.

Value

The quadratic character: 0, 1, or -1.


Quadratic Residues in a Finite Field Finds the nonzero quadratic residues in GF(p^m).

Description

Quadratic Residues in a Finite Field Finds the nonzero quadratic residues in GF(p^m).

Usage

quadraticResiduesGF(p, m)

Arguments

p

A prime number.

m

A positive integer specifying the field extension degree.

Value

A matrix containing the nonzero quadratic residues of GF(p^m).


Quadratic Residues Modulo a Prime Computes the nonzero quadratic residues modulo a prime number.

Description

Quadratic Residues Modulo a Prime Computes the nonzero quadratic residues modulo a prime number.

Usage

quadraticResiduesPrime(q)

Arguments

q

A prime number.

Value

A vector containing the nonzero quadratic residues modulo q.


Performs a simulation study to evaluate the ability of a design to identify active main effects using best-subsets regression and the AICc criterion.

Description

Performs a simulation study to evaluate the ability of a design to identify active main effects using best-subsets regression and the AICc criterion.

Usage

simulation(X, SNR, n.active, nrep = 1000)

Arguments

X

A design matrix containing the mixed-level factors.

SNR

A numeric value specifying the signal-to-noise ratio.

n.active

An integer specifying the number of active factors.

nrep

An integer specifying the number of simulation replications. Default is 1000.

Value

A data frame containing the SNR, number of active factors, power, and Type I error rate.

Examples

## Not run: 
X <- matrix(rnorm(20 * 5), nrow = 20, ncol = 5)
simulation(X, SNR = 1, n.active = 2, nrep = 100)

## End(Not run)

Remove Duplicate Finite-Field Elements Removes duplicate rows from a matrix of finite-field elements.

Description

Remove Duplicate Finite-Field Elements Removes duplicate rows from a matrix of finite-field elements.

Usage

uniqueGFElements(M)

Arguments

M

A matrix containing finite-field elements as rows.

Value

A matrix containing the unique finite-field elements.