Description Usage Arguments Details Value Author(s) Examples
View source: R/inputDataMaker.R
function to create needed information as the input of the functions to cluster dose-response cruve patterns.
1 | inputDataMaker(dose, response, ID, inputDataset)
|
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 |
Note that the output of this function can be feed into the function for clustering dose-response curve patterns.
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.
Vahid Nassiri, and Yimer Wasihun
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
## 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.