read.los.data {changeLOS} | R Documentation |
Read data fom a textfile, which contains one row per individual and one time variable per possible transition.
read.los.data(file, sep = ";", header = TRUE, row.names=NULL, pos.id=1, pos.columns)
file |
name of the file to be read. If it does not contain an
absolute path, the file name is relative to the current working directory, getwd() . |
sep |
the field separator character |
header |
a logical value indicating whether the file contains the names of the variables as its first line |
row.names |
a vector of row names. This can be a vector giving the
actual row names, or a single number giving the column of the
table which contains the row names, or character string
giving the name of the table column containing the row names.
If there is a header and the first row contains one fewer field than the number of columns, the first column in the input is used for the row names. Otherwise if 'row.names' is missing, the rows are numbered. Using 'row.names = NULL' forces row numbering. |
pos.id |
the position of the unique id (patient id, admision id) |
pos.columns |
the positions of the columns which are holding the observed times:
|
The data textfile to be read must contain one time variable per
possible transition and one row per individual. An additional variable
contains censoring times. If a transition was not observed for
an individual, the respective row of the textfile has entry Inf
(`infinite') for that variable.
This data structure is well suited for bootstrapping with respect to the number of individuals. It is still concise for the four-state-model for change in LOS; note that this model does not allow for backward transitions. However, for a larger number of possible transitions, this data structure will be less desirable.
a data frame of the form data.frame(id,j.01,j.02,j.03,j.12,j.13,cens)
id |
id (patient id, admision id) |
j.01 |
observed time for jump from 0 (initial state) to 1 (intermediate state) |
j.02 |
observed time for jump from 0 to 2 (discharge) |
j.03 |
observed time for jump from 0 to 3 (death) |
j.12 |
observed time for jump from 1 to 2 |
j.13 |
observed time for jump from 1 to 3 |
cens |
censoring time (either in initial or intermediate state) |
Matthias Wangler mw@imbi.uni-freiburg.de
## Locate data file "los.data.csv" in sub-directory of package "changeLOS" filename <- paste(searchpaths()[seq(along=search())[search()== "package:changeLOS"]], "/data/los.data.csv", sep="") los.data <- read.los.data(filename,pos.id=1,pos.columns=c(2,3,4,5,6,7)) ## Results in the same data frame as: data(los.data)