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-10-31 21:08:17 UTC |
Source: | https://github.com/cran/CPCAT |
Performs the closure principle computational approach test (CPCAT).
CPCAT(z, M = 10000)
CPCAT(z, M = 10000)
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. |
A p-value for each main hypotheses H_0i: mu_0=mu_i "control vs. treatment i".
data(testdata) CPCAT(testdata) CPCAT(z=testdata) CPCAT(z=testdata, M=1000)
data(testdata) CPCAT(testdata) CPCAT(z=testdata) CPCAT(z=testdata, M=1000)
Create main hypotheses and intersection hypotheses.
hypotheses(n)
hypotheses(n)
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. |
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.
hypotheses(3) hypotheses(n=2)
hypotheses(3) hypotheses(n=2)
Perform a computational approach test (CAT).
poisson.sub.test(dat, contrast, M = 10000)
poisson.sub.test(dat, contrast, M = 10000)
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. |
A p-value for testing one intersection hypothesis.
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)
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.
poisson.test(Data, contrastmatrix, M = 10000)
poisson.test(Data, contrastmatrix, M = 10000)
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. |
The set of p-values according to the intersection hypotheses and the maximum p-value.
#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)
#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)
The data set testdata contains two variables.
testdata
testdata
A data frame with 20 rows and 2 variables:
Contains 20 realizations of Poisson distributed random variables.
Contains the group names of the Poisson data.
Artificial example data.
data(testdata) #Lazy loading of the test data. To view the data type testdata.
data(testdata) #Lazy loading of the test data. To view the data type testdata.
The data set testdata2 contains two variables.
testdata2
testdata2
A data frame with 16 rows and 2 variables:
Contains 16 realizations of Poisson distributed random variables.
Contains the group names of the Poisson data.
Artificial example data.
data(testdata2) #Lazy loading of the test data. To view the data type testdata.
data(testdata2) #Lazy loading of the test data. To view the data type testdata.