inputDataMaker {clustDRM}R Documentation

Creating suitable inputData for clustering of the dose-response curve patterns

Description

function to create needed information as the input of the functions to cluster dose-response cruve patterns.

Usage

inputDataMaker(dose, response, ID, inputDataset)

Arguments

dose

either a single string or a scalar, indicating the name of the dose column or its index.

response

either a single string or a scalar, indicating the name of the response column or its index.

ID

either a single string or a scalar, indicating the name of the ID column or its index.

inputDataset

a data frame containing the input dataset, it should at least include dose, response, and ID

Details

Note that the output of this function can be feed into the function for clustering dose-response curve patterns.

Value

a list with the following elements:

inputDataset: includes the ID (first column), and the response for all doses with their replications for each subject as rows. doseLevels: unique dose levels numReplicatrions: number of replicatios per each unique dose level. colsData: the index of columns with responses. colID: the index of ID column.

Author(s)

Vahid Nassiri, and Yimer Wasihun

Examples

 
## gnerating data
set.seed(11)
doses2Use <-  c(0, 5, 20)
numRep2Use <- c(3, 3, 3)
generatedData <- cbind(rep(1,sum(numRep2Use)), 
MCPMod::genDFdata("logistic",c(5, 3, 10, 0.05), 
doses2Use, numRep2Use, 1), 
		matrix(rnorm(1*sum(numRep2Use)), sum(numRep2Use), 1))
colnames(generatedData) <- c("ID", "dose", "response", "x1")
for (iGen in 2:15){
	genData0 <- cbind(rep(iGen,sum(numRep2Use)), 
MCPMod::genDFdata("logistic",c(5, 3, 10, 0.05), 
doses2Use, numRep2Use, 1), 
			matrix(rnorm(1*sum(numRep2Use)), sum(numRep2Use), 1))
	colnames(genData0) <- c("ID", "dose", "response", "x1")
	generatedData <- rbind(generatedData, genData0)
}
## transforming it for clustering
toInput <- inputDataMaker(2, 3, 1, generatedData)


[Package clustDRM version 0.1-0 Index]