Package 'CPCAT'

Title: The Closure Principle Computational Approach Test
Description: P-values and no/lowest observed (adverse) effect concentration values derived from the closure principle computational approach test (Lehmann, R. et al. (2015) <doi:10.1007/s00477-015-1079-4>) are provided. The package contains functions to generate intersection hypotheses according to the closure principle (Bretz, F., Hothorn, T., Westfall, P. (2010) <doi:10.1201/9781420010909>), an implementation of the computational approach test (Ching-Hui, C., Nabendu, P., Jyh-Jiuan, L. (2010) <doi:10.1080/03610918.2010.508860>) and the combination of both, that is, the closure principle computational approach test.
Authors: René Lehmann [aut, cre]
Maintainer: RenĂ© Lehmann <[email protected]>
License: GPL (>= 3)
Version: 1.0.0
Built: 2024-11-27 05:40:22 UTC
Source: https://github.com/cran/CPCAT

Help Index


Performs the closure principle computational approach test (CPCAT).

Description

Performs the closure principle computational approach test (CPCAT).

Usage

CPCAT(z, M = 10000)

Arguments

z

The data set to be used. One column of z must contain the numeric Poisson data and one must contain the factor variable. The first level of the factor variable is assumed to be the control group. Factor levels (i.e., groups) should be in ascending order (e.g. increasing concentration of a test substance). If the data frame contains more than one numeric column and/or more than one factor variable the CPCAT is applied to the first numeric column and the corresponding Poisson data are grouped according the first factor variable.

M

The number of parametric bootstrap simulations. Defaults to M=10000.

Value

A p-value for each main hypotheses H_0i: mu_0=mu_i "control vs. treatment i".

Examples

data(testdata)
CPCAT(testdata)
CPCAT(z=testdata)
CPCAT(z=testdata, M=1000)

Create main hypotheses and intersection hypotheses.

Description

Create main hypotheses and intersection hypotheses.

Usage

hypotheses(n)

Arguments

n

The number of treatments exclusive of the control group. That is, if we have, e.g., a control group and 3 treatments choose n=3.

Value

A contrast matrix reflecting all main and intersection hypotheses induced by the closure principle (CP). Please note that the leading column of treatment 0 (i.e., the control group) is not displayed because it always contains only ones.

Examples

hypotheses(3)
hypotheses(n=2)

Perform a computational approach test (CAT).

Description

Perform a computational approach test (CAT).

Usage

poisson.sub.test(dat, contrast, M = 10000)

Arguments

dat

A list. The first list element contains the Poisson data of the control group, the second list element contains the Poisson data of the first treatment group etc..

contrast

A matrix consisting of one row and ncol=number of treatments. The values must be either 0 or 1. 1 (0) includes (excludes) the corresponding treatment from the CAT procedure. For example consider 1 control group and 4 treatment groups. For testing H0: mu_0=mu_1=mu_4 choose contrast=matrix(c(1,0,0,1),nrow = 1).

M

The number of parametric bootstrap simulations. Defaults to M=10000.

Value

A p-value for testing one intersection hypothesis.

Examples

data(testdata)
#Extract the group names from testdata.
conc<-unique(testdata[,2])	#concentration levels of the test data
#Extract the number of treatment groups.
N=length(conc)-1
#Devide the testdata into a list where the first element contains
#the Poisson data of the control group and the following contain
#the Poisson data of the treatment groups, respectively.
dat<-list()
#Create the final list.
for(j in 1:length(conc)){
index<-which(testdata[,2]==conc[j])
dat[[j]]<-testdata[index,]
}
#Show the data list.
dat
#Generate the intersection hypotheses of H01: mu_0=mu_1 using the
#hypotheses function.
C=hypotheses(N)[[1]]
#Show the first intersection hypothesis.
C[1,]
#Test the first intersection hypothesis.
poisson.sub.test(dat=dat,contrast=C[1,],M=10000)

Perform the closure principle computational approach test (CPCAT) for one main hypothesis H0i: mu_0=mu_i.

Description

Perform the closure principle computational approach test (CPCAT) for one main hypothesis H0i: mu_0=mu_i.

Usage

poisson.test(Data, contrastmatrix, M = 10000)

Arguments

Data

The data matrix.

contrastmatrix

The contrasts according to the closure principle induced intersection hypotheses.

M

The number of parametric bootstrap simulations. Defaults to M=10000.

Value

The set of p-values according to the intersection hypotheses and the maximum p-value.

Examples

#Consider a data set of one control group and 3 treatment groups
data(testdata2)
#Test the main hypothesis H0: mu_0=mu_1 using M=10000
#simulation runs
C=hypotheses(3)[[1]] #Generate the set of intersection hypotheses
#according to H0
poisson.test(testdata2,contrastmatrix=C,M=10000)

Description of testdata

Description

The data set testdata contains two variables.

Usage

testdata

Format

A data frame with 20 rows and 2 variables:

Poissondata

Contains 20 realizations of Poisson distributed random variables.

group

Contains the group names of the Poisson data.

Source

Artificial example data.

Examples

data(testdata)    #Lazy loading of the test data. To view the data type testdata.

Description of testdata2

Description

The data set testdata2 contains two variables.

Usage

testdata2

Format

A data frame with 16 rows and 2 variables:

Poissondata

Contains 16 realizations of Poisson distributed random variables.

group

Contains the group names of the Poisson data.

Source

Artificial example data.

Examples

data(testdata2)    #Lazy loading of the test data. To view the data type testdata.