# isGYD: Checking Simple Block and Row-Column Designs for Balance In crossdes: Construction of Crossover Designs

## Description

A function to check a simple block or a row-column design for balance. The rows and columns of the design are blocking variables. It is checked which type of balance the design fulfills. Optionally, incidence and concurrence matrices are given.

## Usage

 `1` ```isGYD(d, tables=FALSE, type=TRUE) ```

## Arguments

 `d` A matrix representing the experimental design. The treatments must be numbered 1,...,trt. `tables` Logical flag. If TRUE, incidence matrices are displayed. `type` Logical flag. If TRUE, the type of design is displayed.

## Details

A design is said to be a balanced block design if the following three conditions hold: i) Each treatment appears equally often in the design. ii) The design is binary in the sense that each treatment appears in each block either n or n+1 times where n is an integer. iii) The number of concurrences of treatments i and j is the same for all pairs of distinct treatments (i,j). Here the blocks are either rows or columns.

A design that has less columns (rows) than treatments is said to be incomplete with respect to rows (columns). A design that is balanced with respect to both rows and columns is called a generalized Youden design (GYD). A GYD for which each treatment occurs equally often in each row (column) is called uniform on the rows (columns). If both conditions hold, it is called a generalized latin square. A design where each treatment occurs exactly once in each row and column is called a latin square.

## Value

A list containing information about balance in rows and columns as well as incidence and concurrence matrices for the design.

## Author(s)

Oliver Sailer

`isCbalanced`

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12``` ```d1 <- matrix( c(1,2,3,4,1,1,1,1), 4,2) # d1 is not balanced d2 <- matrix( c(1:4,2:4,1,4,1:3,3,4,1,2),ncol=4) # d2 is a latin square d3 <- matrix( rep(1:3,each=2), ncol=2) # d3 is a balanced incomplete block design. d1 isGYD(d1,tables=TRUE) d2 isGYD(d2,tables=TRUE) d3 isGYD(d3,tables=TRUE) ```

### Example output

```Loading required package: AlgDesign
[,1] [,2]
[1,]    1    1
[2,]    2    1
[3,]    3    1
[4,]    4    1

[1] The design is neither balanced w.r.t. rows nor w.r.t. columns.

\$`Number of occurrences of treatments in d`
1 2 3 4
5 1 1 1

\$`Row incidence matrix of d`
1 2 3 4
1 2 1 1 1
2 0 1 0 0
3 0 0 1 0
4 0 0 0 1

\$`Column incidence matrix of d`
1 2
1 1 4
2 1 0
3 1 0
4 1 0

\$`Concurrence w.r.t. rows`
1 2 3 4
1 7 1 1 1
2 1 1 0 0
3 1 0 1 0
4 1 0 0 1

\$`Concurrence w.r.t. columns`
1 2 3 4
1 17 1 1 1
2  1 1 1 1
3  1 1 1 1
4  1 1 1 1

[,1] [,2] [,3] [,4]
[1,]    1    2    4    3
[2,]    2    3    1    4
[3,]    3    4    2    1
[4,]    4    1    3    2

[1] The design is a latin square.

\$`Number of occurrences of treatments in d`
1 2 3 4
4 4 4 4

\$`Row incidence matrix of d`
1 2 3 4
1 1 1 1 1
2 1 1 1 1
3 1 1 1 1
4 1 1 1 1

\$`Column incidence matrix of d`
1 2 3 4
1 1 1 1 1
2 1 1 1 1
3 1 1 1 1
4 1 1 1 1

\$`Concurrence w.r.t. rows`
1 2 3 4
1 4 4 4 4
2 4 4 4 4
3 4 4 4 4
4 4 4 4 4

\$`Concurrence w.r.t. columns`
1 2 3 4
1 4 4 4 4
2 4 4 4 4
3 4 4 4 4
4 4 4 4 4

[,1] [,2]
[1,]    1    2
[2,]    1    3
[3,]    2    3

[1] The design is a balanced incomplete block design w.r.t. rows.

\$`Number of occurrences of treatments in d`
1 2 3
2 2 2

\$`Row incidence matrix of d`
1 2 3
1 1 1 0
2 1 0 1
3 0 1 1

\$`Column incidence matrix of d`
1 2
1 2 0
2 1 1
3 0 2

\$`Concurrence w.r.t. rows`
1 2 3
1 2 1 1
2 1 2 1
3 1 1 2

\$`Concurrence w.r.t. columns`
1 2 3
1 4 2 0
2 2 2 2
3 0 2 4
```

crossdes documentation built on May 30, 2017, 4:14 a.m.