call_simp() function
added March 28, 2013
Code File
The code for the call_simp() function is contained in the file call_simp.R. You can source the file directly into R by calling
source("http://www.biostat.jhsph.edu/~pmurakam/call_simp.R")Copyright (C) 2013 Johns Hopkins University
Manual page
Description: A wrapper function to call the simp() function. Given a .csv file with one subject's file per row, each file will be fed to the simp() function. Saves .csv and .pdf files with the results. Usage: call_simp(file, eventcol, timecol, events=list(c("pH","MII"),"pH","MII"), outcome="OA", outpath, method=c(1,2,3), gap.symptom=c(0,6,0), gap.rf=c(0,30,0), interval=seq(15,300,by=15), numiter=10000, qvalues=FALSE, alpha=0.05, ...) Arguments: file - a .csv file with one subject's file name (with full path) per row. Only one column. Each file should contain a table to be read in as the tab argument to simp. The first row should be a file name, not a column name. eventcol - the name of the column of each file (after it is read in) for the events. All rows of the tables that come after "study end" are ignored. Note that column names may change when read into R if they contain spaces special characters. timecol - the name of the column of each file (after it is read in) for the time from start for each event. Note that column names may change when read into R if they contain spaces special characters. events - the values in the eventcol column to use as the predictor events. If a vector of values is provided, all the values are considered as predictor events. If a list of such values or vectors of values is provided, separate analyses are done for each element of the list. outcome - the value in the eventcol column to use as the symptom event. outpath - where to save all the output files method - see the help file for simp. If a vector is provided, a separate analysis is done for each method. gap.symptom - see the help file for simp. One for each element of method, in the same order, i.e., the first gap.symptom is used for the first element of method, the second for the second, and the third for the third. gap.rf - see the help file for simp. One for each element of method, in the same order, i.e., the first gap.rf is used for the first element of method, the second for the second, and the third for the third. interval - see the help file for simp. numiter - see the help file for simp. qvalues - TRUE to report FDR q-values instead of p-values. FALSE to use p-values. the q-values account for all the tests for all the intervals specified. alpha - significance level by which to color points in the plots ... - additional arguments to simp. Details: call_simp takes a .csv file where each row is the full file name of the .csv file for each subject. Each .csv file has a column for event type and another for the elapsed time from study start (assumed to be 0). All other columns are ignored. The simp function is called on each subject's table. Event type labels for events of the potentially predictive category must be specified (e.g., "pH","MII"), as does the label of to the symptom category (e.g., "OA"). Value: A list with simp output for SI and SSI, for each method specified and each element of the events argument if it is a list. See also: simp() Examples: ## Not run: #source("http://www.biostat.jhsph.edu/~pmurakam/simp.R") #out = call_simp(file = "inputfile.csv", eventcol = "CReventtype", timecol = "time.offset..seconds.", outpath = ".", numiter=100)