Version: 1.6
Date: 2024-01-23
Title: Incomplete Block Designs
Author: B N Mandal [aut, cre]
Maintainer: B N Mandal <mandal.stat@gmail.com>
Depends: R (≥ 3.1.1)
Imports: lpSolve, car, emmeans, multcomp
Suggests: multcompView
Description: A collection of several utility functions related to binary incomplete block designs. Contains function to generate A- and D-efficient binary incomplete block designs with given numbers of treatments, number of blocks and block size. Contains function to generate an incomplete block design with specified concurrence matrix. There are functions to generate balanced treatment incomplete block designs and incomplete block designs for test versus control treatments comparisons with specified concurrence matrix. Allows performing analysis of variance of data and computing estimated marginal means of factors from experiments using a connected incomplete block design. Tests of hypothesis of treatment contrasts in incomplete block design set up is supported.
License: GPL-2 | GPL-3 [expanded from: GPL (≥ 2)]
NeedsCompilation: no
Packaged: 2024-01-23 09:03:06 UTC; PC
Repository: CRAN
Date/Publication: 2024-01-23 09:50:02 UTC

A-efficiency of A Binary Incomplete Block Design

Description

Computes lower bound to A-efficiency of a binary incomplete block design. Treatment by block incidence matrix of the design is to be supplied as input to the function.

Usage

A_eff(N)

Arguments

N

Treatment by block incidence matrix

Value

Aeff

A-efficiency

Author(s)

Baidya Nath Mandal <mandal.stat@gmail.com>

Examples

N=matrix(c(1,0,0,0,1,0,1,0,0,0,1,0,1,1,0,0,1,0,1,1,0,1,0,1,1,0,0,0,0,1,1,0,0,0,1,1,1,0,0,0,1,0,0,
1,0,1,1,0,0),nrow=7,byrow=TRUE)
A_eff(N)

A-efficiency of A Proper Binary Incomplete Block Design

Description

This function computes lower bound to A-efficiency of a binary proper incomplete block design given the block size, number of blocks and concurrence matrix.

Usage

A_eff.NNP(b,k,NNP)

Arguments

b

number of blocks

k

block size

NNP

concurrence matrix

Value

Aeff

A-efficiency

Author(s)

Baidya Nath Mandal <mandal.stat@gmail.com>


Information Matrix of a Block Design

Description

Gives the information matrix from a given treatment by block incidence matrix of a block design

Usage

Cmatrix(N)

Arguments

N

treatment by block incidence matrix

Value

Cmatrix

v by v information matrix where v is number of treatments

Author(s)

Baidya Nath Mandal <mandal.stat@gmail.com>

Examples

N = matrix(c(1,0,0,0,1,0,1,0,0,0,1,0,1,1,0,0,1,0,1,1,0,1,0,1,1,0,0,0,0,1,1,0,0,0,1,1,1,0,0,0,1,0,0
,1,0,1,1,0,0),nrow=7,byrow=TRUE)
Cmatrix(N)
Information.Matrix(N)

D-efficiency of a Binary Incomplete Block Design

Description

Computes lower bound to D-efficiency of a binary incomplete block design

Usage

D_eff(N)

Arguments

N

treatment by block incidence matrix

Value

Deff

lower bound to D-efficiency

Author(s)

Baidya Nath Mandal <mandal.stat@gmail.com>

Examples

N=matrix(c(1,0,0,0,1,0,1,0,0,0,1,0,1,1,0,0,1,0,1,1,0,1,0,1,1,0,0,0,0,1,1,0,0,0,1,1,1,0,0,0,1,0,0
,1,0,1,1,0,0),nrow=7,byrow=TRUE)
D_eff(N)

Linear Integer Programming Formulation to Update Incidence Matrix

Description

Updates an incidence matrix by adding a row through linear integer programming formulation for given number of treatments, number of blocks, block sizes and concurrence matrix and the previous rows of incidence matrix

Usage

LIP(v,b,kvec,NNPo,N1,T,rownum,relaxed,binary=TRUE)

Arguments

v

number of treatments

b

number of blocks

kvec

block sizes

NNPo

specified concurrence matrix

N1

incidence matrix upto previous rows

T

tabu list of deleted rows

relaxed

whether concurrence constraints are to be relaxed? value 1 for yes, 0 for no. Default is 0.

binary

All decision variables are binary to get a binary block. Default is TRUE.

Value

return the updated incidence matrix

Author(s)

Baidya Nath Mandal <mandal.stat@gmail.com>


An Alternative Approach to Obtain a Block Design with Specified Concurrence Matrix

Description

Generates a block design with specified parameters and concurrence matrix through an alternative linear integer programming approach

Usage

NLIP(v,b,k,NNPo)

Arguments

v

number of test treatments

b

number of blocks

k

block size

NNPo

specified concurrence matrix

Value

Returns a design or a text saying that no design found

Author(s)

Baidya Nath Mandal <mandal.stat@gmail.com>

References

Mandal, B. N., Gupta, V. K., & Parsad, R. (2012). Generation of Binary Incomplete Block Design with a Specified Concurrence Matrix. Journal of Statistics & Applications, 7.


Block Design from Given Treatment by Block Incidence Matrix

Description

Generates the block contents from a given treatment by block incidence matrix

Usage

N_to_design(N)
design(N)

Arguments

N

treatment by block incidence matrix

Value

design

a matrix with number of rows equal to number of blocks and number of columns equal to block size. Constant block size is assumed. Treatments are labelled as 1, 2, ..., v.

Author(s)

Baidya Nath Mandal <mandal.stat@gmail.com>

Examples

N=matrix(c(1,0,0,0,1,0,1,0,0,0,1,0,1,1,0,0,1,0,1,1,0,1,0,1,1,0,0,0,0,1,1,0,0,0,1,
1,1,0,0,0,1,0,0,1,0,1,1,0,0),nrow=7,byrow=TRUE)
N_to_design(N)
design(N)

Analysis of Variance, Estimated Marginal Means and Contrast Analysis of Data from An Incomplete Block Design

Description

Performs intrablock analysis of variance of data from experiments using a block design. It also computes estimated marginal means of the factor variables (e.g. treatments) and optionally estimates and tests the contrasts of factor variables (e.g treatments).

Usage

aov.ibd(formula,specs,data,contrast,joint=FALSE,details=FALSE,sort=TRUE,by=NULL,
alpha=0.05,Letters = "ABCDEFGHIJ",...)

Arguments

formula

A formula specifying the model of the form response~treatment+block or response~block+treatment. Make sure the treatment and blocks are factor variables.

specs

A character vector specifying the names of the factors over which estimated marginal means are desired

data

A data frame in which the variables specified in the formula will be found. If missing, the variables are searched for in the standard way.

contrast

A matrix whose rows are contrasts of factors (e.g. treatments)

joint

If contrast argument has more than one row, then whether a joint test of the contrasts will be performed. Default is FALSE. If joint=TRUE, a check is performed whether the contrasts are pairwise orthogonal or not and then if orthoghonal, joint test is performed.

details

Logical, if details=TRUE then all objects including lm object from lm(), emmGrid object from emmeans() are returned. Default is FALSE.

sort

Logical value determining whether the least square means are sorted before the comparisons are produced. Default is TRUE.

by

Character value giving the name or names of variables by which separate families of comparisons are tested. If NULL, all means are compared.

alpha

Numeric value giving the significance level for the comparisons

Letters

Characters to be used for compact letter display of groups of factor variables over which least square means are computed. Default is english alphabet capital letters "ABCDEFGHIJ"

...

Not used

Details

The function makes use of lm() function in R and Anova() function in car package with specification of Type III sum of squares and emmeans(), contrast() functions in emmeans() package, cld() function in multcomp package and combines the results in a single place.

Value

Returns a list with following components

lm.obj

An object of class lm if details=TRUE

ANOVA.table

ANOVA table from the fitted lm object

EMMEANS

Estimated marginal means means with compact letter display

contrast.analysis

Contrast analysis result if contrast matrix was supplied

Author(s)

Baidya Nath Mandal <mandal.stat@gmail.com>

Examples

data(ibddata)
aov.ibd(y~factor(trt)+factor(blk),data=ibddata)
contrast=matrix(c(1,-1,0,0,0,0,0,0,0,0,0,1,-1,0,0,0,0,0),nrow=2,byrow=TRUE)
aov.ibd(y~factor(trt)+factor(blk),specs="trt",data=ibddata,contrast=contrast)

Balanced Incomplete Block Design for Given Parameters

Description

Generates a balanced incomplete block design with given number of treaments (v), number of blocks (b), number of replications (r), block size (k) and number of concurrences (lambda).

Usage

bibd(v,b,r,k,lambda,ntrial=5,pbar=FALSE)

Arguments

v

number of treatments

b

number of blocks

r

number of replications

k

block size

lambda

number of concurrences

ntrial

number of trials. Default value is 5.

pbar

logical value indicating whether progress bar will be displayed or not. Default is FALSE

Value

v

number of treatments

b

number of blocks

r

number of replications

k

block size

lambda

number of concurrences

design

block contents in a b by k matrix

N

treatments by blocks incidence matrix of the generated design

NNP

concurrence matrix of the generated design

Aeff

Lower bound to the A-efficiency of the generated design

Deff

Lower bound to the D-efficiency of the generated design

Note

The function works best for values of number of treatments (v) up to 30 and block size (k) up to 10. However, for block size (k) up to 3, much larger values of number of treatments (v) may be used.

Author(s)

Baidya Nath Mandal <mandal.stat@gmail.com>

References

Mandal, B. N., Gupta, V. K. and Parsad, R. (2013). Application of optimization techniques for construction of incomplete block designs. Project report, IASRI, New Delhi.

Mandal, B. N., Gupta, V. K., & Parsad, R. (2014). Efficient Incomplete Block Designs Through Linear Integer Programming. American Journal of Mathematical and Management Sciences, 33(2), 110-124.

Mandal, B. N. (2015). Linear integer programming approach to construction of balanced incomplete block designs. Communications in Statistics-Simulation and Computation, 44:6, 1405-1411.

Examples

bibd(7,7,3,3,1)
bibd(9,12,4,3,1)

Balanced Treatment Incomplete Block Designs

Description

Generates a balanced treatment incomplete block design for specified parameters.

Usage

btib(v,b,r,r0,k,lambda,lambda0,ntrial=5,pbar=FALSE)

Arguments

v

number of test treatments

b

number of blocks

r

number of replications of test treatments

r0

number of replications of the control treatment

k

block size

lambda

number of concurrences among test treatments

lambda0

number of concurrences between test treatments and the control treatment

ntrial

number of trials. Default is 5.

pbar

logical value indicating whether progress bar will be displayed or not. Default is FALSE.

Value

v

number of test treatments

b

number of blocks

r

number of replications of test treatments

r0

number of replications of the control treatment

k

block size

lambda

number of concurrences among test treatments

lambda0

number of concurrences between test treatments and the control treatment

design

generated block design

N

treatment by block incidence matrix of the generated block design

NNP

concurrence matrix of the generated design

Aeff

A-efficiency of the generated design

Note

The function works best for values of number of treatments (v) up to 30 and block size (k) up to 10. However, for block size (k) up to 3, much larger values of number of treatments (v) may be used.

Author(s)

Baidya Nath Mandal <mandal.stat@gmail.com>

References

Mandal, B. N., Gupta, V. K. and Parsad, R. (2013). Application of optimization techniques for construction of incomplete block designs. Project report, IASRI, New Delhi.

Mandal, B. N., Gupta, V. K., & Parsad, R. (2014). Balanced treatment incomplete block designs through integer programming, Communications in Statistics - Theory and Methods, 46:8, 3728-3737.

Examples

btib(4,6,3,6,3,1,3,10)

Balanced Treatment Incomplete Block Designs

Description

Generates a balanced treatment incomplete block design for specified parameters by searching all possible combinations.

Usage

btib1(v,b,r,r0,k,lambda,lambda0)

Arguments

v

number of test treatments

b

number of blocks

r

number of replications of test treatments

r0

number of replications of the control treatment

k

block size

lambda

number of concurrences among test treatments

lambda0

number of concurrences between test treatments and control treatment

Value

v

number of test treatments

b

number of blocks

r

number of replications of test treatments

r0

number of replications of control treatment

k

block size

lambda

number of concurrences among test treatments

lambda0

number of concurrences between test treatments and control treatment

design

generated block design

N

treatment by block incidence matrix of the generated block design

NNP

concurrence matrix of the generated design

Aeff

A-efficiency of the generated design

Note

The function works best for values of number of treatments (v) up to 30 and block size (k) up to 10. However, for block size (k) up to 3, much larger values of number of treatments (v) may be used.

Author(s)

Baidya Nath Mandal <mandal.stat@gmail.com>

References

Mandal, B. N., Gupta, V. K. and Parsad, R. (2013). Application of optimization techniques for construction of incomplete block designs. Project report, IASRI, New Delhi.

MANDAL, B. N., GUPTA, V. K. and PARSAD, R. (2012). Generation of Binary Incomplete Block Design with a Specified Concurrence Matrix. Journal of Statistics & Applications, 7.

Examples

btib(4,6,3,6,3,1,3)

Treatment by Block Incidence Matrix of a BTIB Design

Description

This function generate an incidence matrix of a BTIB design for given v,b,k and concurrence matrix

Usage

btibgen(v,b,k,NNPo,ntrial,pbar)

Arguments

v

number of treatments

b

number of blocks

k

block size

NNPo

specified concurrence matrix

ntrial

number of trials, default is 5

pbar

logical, progress bar to be displayed. Default is FALSE

Value

returns a v by b incidence matrix or a text that design was not found

Author(s)

Baidya Nath Mandal <mandal.stat@gmail.com>


Concurrence Matrix for Given v, b and k

Description

Generates a nearly balanced concurrence matrix from given number of treatments (v), number of blocks (b) and block size (k) by trial and error.

Usage

ccmat(v,b,k)

Arguments

v

number of treatments

b

number of blocks

k

block size

Value

A v by v matrix is returned if a desired concurrence matrix is found, else it returns a v by v matrix of zeros. If the parameters are infeasible for a nearly balanced concurrence matrix, the function returns the parameter values.

Author(s)

Baidya Nath Mandal <mandal.stat@gmail.com>


Concurrence Matrix for Given v, b and k

Description

Generates the nearly balanced concurrence matrix from given number of treatments (v), number of blocks (b) and block size (k)

Usage

ccmat_LP(v,b,k)

Arguments

v

number of treatments

b

number of blocks

k

block size

Value

A v by v matrix is returned if a desired concurrence matrix is found, else it returns 0.

Author(s)

Baidya Nath Mandal <mandal.stat@gmail.com>


Orthogonality of Rows of a Given Matrix

Description

Checks whether rows of a given matrix are pairwise orthogonal or not. Returns a value 1 if the rows are pairwise orthogonal, else return 0.

Usage

check.orthogonality(M)

Arguments

M

a matrix

Value

A value of 1 if rows of the matrix are pairwise orthogonal else 0.

Author(s)

Baidya Nath Mandal <mandal.stat@gmail.com>


Whether a Given Matrix is Concurrence Matrix or Not

Description

Checks whether a v by v matrix is concurrence matrix or not. Mainly it checks whether the sum of off-diagonal elements of the matrix is (k-1) times the diagonal element for each row of the given matrix. Applicable for proper binary incomplete block design only. If the condition is satisfied, it returns a value of 1 else it returns 0.

Usage

check.validity.NNP(NNP,k)

Arguments

NNP

a v by v matrix

k

block size

Value

A value of 1 for valid concurrence matrix or 0 for non valid matrix.

Author(s)

Baidya Nath Mandal <mandal.stat@gmail.com>


Block Design to Treatment by Block Incidence Matrix

Description

Generates treatment by block incidence matrix from a given block design

Usage

design_to_N(design)
N(design)

Arguments

design

design

Value

N

A treatment by block incidence matrix of order v by b with elements as 0 and 1 where v is the number of treatments and b is the number of blocks

Author(s)

Baidya Nath Mandal <mandal.stat@gmail.com>

Examples

design = matrix(c(1,4,6,5,6,7,3,4,5,2,4,7,1,3,7,2,3,6,1,2,5),nrow=7,byrow=TRUE)
design_to_N(design)
# or alternatively
N(design)

Existence of A Nearly Balanced Incomplete Block Design Given The Parameters

Description

Checks whether a nearly balanced incomplete block design exists or not for given parameters

Usage

do.exist.NBIB(v,b,k)

Arguments

v

number of treatments

b

number of blocks

k

block size

Value

Returns 1 if an NBIB design exists else return 0

Author(s)

Baidya Nath Mandal <mandal.stat@gmail.com>


g Function

Description

Computes value of g function for given v,b,k,x,z

Usage

g(v,b,k,x,z)

Arguments

v

number of treatments

b

number of blocks

k

block size

x

x

z

z

Value

value

Value of g function

Author(s)

Baidya Nath Mandal <mandal.stat@gmail.com>


gts Value

Description

Computes minimum value of g function for over permissible values of x,z for given v,b,k

Usage

gts(v,b,k)

Arguments

v

number of treatments

b

number of blocks

k

block size

Value

ming

Minimum value of g function

Author(s)

Baidya Nath Mandal <mandal.stat@gmail.com>


Binary Incomplete Block Design for Given v, b and k and Optionally, with a Specified Concurrence Matrix

Description

Generates an A- and D- efficient binary incomplete block design with given number of treaments(v), number of blocks(b) and block size(k) and optionally with a specified concurrence matrix(NNP).

Usage

ibd(v,b,k,NNPo,ntrial=5,pbar=FALSE)

Arguments

v

number of treatments

b

number of blocks

k

block size

NNPo

optionally, desired concurrence matrix. If not specified, a nearly balanced concurrence matrix is obtained automatically.

ntrial

number of trials. Default is 5.

pbar

progress bar. Default is FALSE.

Value

v

number of treatments

b

number of blocks

k

block size

NNP

specified concurrence matrix

N

incidence matrix of the generated design

design

block contents in a b by k matrix

conc.mat

concurrence matrix of the generated design

A.efficiency

lower bound to A-efficiency of the generated design

D.efficiency

lower bound to D-efficiency of the generated design

time.taken

time taken to generate the design

Note

This function works best for values of number of treatments (v) up to 30 and block size (k) up to 10. However, for block size (k) up to 3, much larger values of number of treatments (v) may be used.

Author(s)

Baidya Nath Mandal <mandal.stat@gmail.com>

References

Mandal, B. N., Gupta, V. K. and Parsad, R. (2013). Application of optimization techniques for construction of incomplete block designs. Project report, IASRI, New Delhi.

Mandal, B. N., Gupta, V. K., & Parsad, R. (2014). Efficient Incomplete Block Designs Through Linear Integer Programming. American Journal of Mathematical and Management Sciences, 33(2), 110-124.

Examples

ibd(v = 7,b = 7,k = 4, pbar=FALSE)

Data from an Experiment using Incomplete Block Design

Description

Data from an experiment using incomplete block design

Usage

data("ibddata")

Format

A data frame with 36 observations on the following 3 variables.

trt

Treatments

blk

Blocks

y

The response variable

Details

The experiment used a balanced incomplete block design.

References

Dey,A. (1986). Theory of block designs. Wiley Eastern Limited, New Delhi.

Examples

data(ibddata)

Generate a Treatment by Block Incidence Matrix for Given v,b,k, and Concurrence Matrix

Description

Generates an incidence matrix for given v,b,k and concurrence matrix

Usage

ibdgen(v,b,k,NNPo,ntrial,pbar)

Arguments

v

number of treatments

b

number of blocks

k

block size

NNPo

specified concurrence matrix

ntrial

number of trials, default is 5

pbar

logical, progress bar to be displayed. Default is FALSE

Value

returns a v by b incidence matrix or a text that design was not found

Author(s)

Baidya Nath Mandal <mandal.stat@gmail.com>


Incomplete Block Design for Test vs Control(s) Comparions

Description

Generates an incomplete block design for test vs control(s) comparisons with specified parameters and concurrence matrix.

Usage

ibdtvc(v1,v2,b,k,NNPo,ntrial=5,pbar=FALSE)

Arguments

v1

number of test treatments

v2

number of control treatments

b

number of blocks

k

block size

NNPo

desired concurrence matrix

ntrial

number of trials, default is 5

pbar

logical value indicating whether progress bar will be displayed. Default is FALSE.

Value

v1=v1,v2=v2,b=b,k=k,design=design,N=N, NNP=NNP,Aeff=Aeff)

v1

number of test treatments

v2

number of control treatments

b

number of blocks

k

block size

design

generated block design

N

treatment by block incidence matrix of the generated block design

NNP

concurrence matrix of the generated design

Author(s)

Baidya Nath Mandal <mandal.stat@gmail.com>

References

Mandal, B. N., Gupta, V.K. and Parsad, R. (2013). Binary Incomplete Block Designs with a Specified Concurrence Matrix through Integer Programming, to be submitted for publication

Examples

NNPo=matrix(c(7,3,3,3,3,3,3,3,3,7,3,3,3,3,3,3,3,3,7,3,3,3,3,3,3,3,3,7,3,3,3,3,3,3,3,3,7,
3,3,3,3,3,3,3,3,7,3,3,3,3,3,3,3,3,9,9,3,3,3,3,3,3,9,9),nrow=8,byrow=TRUE)
ibdtvc(6,2,15,4,NNPo)

Interchange the Elements of a Concurrence Matrix to Get Highest Possible Lower Bound to A-efficiency

Description

Interchanges the distinct off-diagonal elements of a given concurrence matrix and produces a concurrence matrix which has highest A-efficiency

Usage

interchange.NNP(b,k,NNP)

Arguments

b

number of blocks

k

block size

NNP

concurrence matrix

Value

A v x v matrix

Author(s)

Baidya Nath Mandal <mandal.stat@gmail.com>


Connctedness of a Binary Incomplete Block Design

Description

Checks whether an incomplete block design is connected or not. Treatment by block incidence matrix of the design is to be supplied as input to the function. If the design is connected, it returns a value of 1 else it returns 0.

Usage

is.connected(N)

Arguments

N

incidence matrix

Value

connected

connctedness

Author(s)

Baidya Nath Mandal <mandal.stat@gmail.com>

Examples

N=matrix(c(1,0,0,0,1,0,1,0,0,0,1,0,1,1,0,0,1,0,1,1,0,1,0,1,1,0,0,0,0,1,1,0,0,0,1,1,1,0,
0,0,1,0,0,1,0,1,1,0,0),nrow=7,byrow=TRUE)
is.connected(N)

Equi-replicateness a Binary Incomplete Block Design

Description

Checks whether an incomplete block design is equi-replicated or not. Treatment by block incidence matrix of the design is to be supplied as input to the function. If the design is equir-eplicated, it returns a value of 1 else it returns 0.

Usage

is.equir(N)

Arguments

N

incidence matrix

Value

equir

equi-replicated

Author(s)

Baidya Nath Mandal <mandal.stat@gmail.com>

Examples

N=matrix(c(1,0,0,0,1,0,1,0,0,0,1,0,1,1,0,0,1,0,1,1,0,1,0,1,1,0,0,0,0,1,1,0,0,0,1,1,1,0,
0,0,1,0,0,1,0,1,1,0,0),nrow=7,byrow=TRUE)
is.equir(N)

Orthogonality a Block Design

Description

Checks whether an incomplete block design is orthogonal or not. Treatment by block incidence matrix of the design is to be supplied as input to the function. If the design is orthogonal, it returns a value of 1 else it returns 0.

Usage

is.orthogonal(N)

Arguments

N

incidence matrix

Value

orthogonal

orthogonal

Author(s)

Baidya Nath Mandal <mandal.stat@gmail.com>

Examples

N=matrix(c(1,0,0,0,1,0,1,0,0,0,1,0,1,1,0,0,1,0,1,1,0,1,0,1,1,0,0,0,0,1,1,0,0,0,1,1,1,0,
0,0,1,0,0,1,0,1,1,0,0),nrow=7,byrow=TRUE)
is.orthogonal(N)

Proper Binary Incomplete Block Design

Description

Checks whether an incomplete block design is proper or not. Treatment by block incidence matrix of the design is to be supplied as input to the function. If the design is proper, it returns a value of 1 else it returns 0.

Usage

is.proper(N)

Arguments

N

incidence matrix

Value

proper

proper

Author(s)

Baidya Nath Mandal <mandal.stat@gmail.com>

Examples

N=matrix(c(1,0,0,0,1,0,1,0,0,0,1,0,1,1,0,0,1,0,1,1,0,1,0,1,1,0,0,0,0,1,1,0,0,0,1,1,1,0,
0,0,1,0,0,1,0,1,1,0,0),nrow=7,byrow=TRUE)
is.proper(N)

Variance Balancedness of a Binary Incomplete Block Design

Description

Checks whether an incomplete block design is variance balanced or not. Treatment by block incidence matrix of the design is to be supplied as input to the function. If the design is variance balanced, it returns a value of 1 else it returns 0.

Usage

is.vb(N)

Arguments

N

incidence matrix

Value

vb

variance balanced

Author(s)

Baidya Nath Mandal <mandal.stat@gmail.com>

Examples

N=matrix(c(1,0,0,0,1,0,1,0,0,0,1,0,1,1,0,0,1,0,1,1,0,1,0,1,1,0,0,0,0,1,1,0,0,0,1,1,1,0,
0,0,1,0,0,1,0,1,1,0,0),nrow=7,byrow=TRUE)
is.vb(N)

Whole Number or Not

Description

Checks whether a given number is whole number or not.

Usage

is.wholenumber(x, tol = .Machine$double.eps^0.5)

Arguments

x

a number

tol

tolerance. Default is tol = .Machine$double.eps^0.5

Value

Returns TRUE or FALSE

Author(s)

Baidya Nath Mandal <mandal.stat@gmail.com>


Randomize a block design

Description

Randomize a given block design

Usage

randomize(design)

Arguments

design

design

Value

design

Block design with a constant block size

Author(s)

Baidya Nath Mandal <mandal.stat@gmail.com>

Examples

design = matrix(c(1,4,6,5,6,7,3,4,5,2,4,7,1,3,7,2,3,6,1,2,5),nrow=7,byrow=TRUE)
randomize(design)