buildViSiGrid
buildViSiGrid
build an object class
ViSigrid
with at least an object class ViSibook
and data of individual realisation
times for each punctual action defined in the ViSibook
.
buildViSiGrid(X, book, Xsup = NULL, method = "global", group = NULL, grwithin = NULL, informer = "median", tests = TRUE, threshold.test = 0.01, quantity = "N", pixel = 20, t_0 = 0, sorted.line = TRUE, decrgr2 = FALSE, max_tps = NULL, colvect = NULL, ncolvect = dim(X)[1], times = FALSE, timeformat = c("hh:mm:ss"), idsubject = 1)
data.frame
or matrix
. X
stores punctual action realization times.
The actions are defined in book
, and X columns names should correspond to the slot "vars" of book
.
X must also have a column to identify individuals.ViSiBook
object.
It stores the process structure.data.frame
or matrix
storing supplementary time data, all indivuals in Xsup
must be in X
."global"
, "cut"
, "join"
, "within"
}.
method
specifies the plotting method, see details
. If group
is NULL
,
method
is set to "global"
.factor
with two levels
.
group
indicates the group attributed to the individuals,
it has same the length as the number of rows of X
.group
.
If method
is set to within
, grwithin
specifies the group to consider.NULL
" , "median
" , "mean
" }.
If informer
is set
to "median" the median and quartiles are computed,
if it is set to "mean" the mean and standard deviation are. If informer
is NULL
no indicators are computed.informer
is not NULL and group
is defined, if tests
is TRUE
, tests are computed to compare groups.
If the parameter informer
is set to "mean
",
the function wilcox.test()
is used, if informer
is set to "median
" the function mood.test()
is used.threshold.test
is the value of the p-value under which the H0 hypothesis
of the test is rejected when tests
is TRUE
.N
" , "dens
" }. quantity
allows choosing the quantity represented for punctual action
When quantity
is set to "N" the number of individuals is considered. Otherwise when it
is set to "dens" proportion of individuals is considered instead. If group
is defined and
method
set to "cut" or "within", this proportion is calculated regarding each represented group.vars
" in book
,
t_0
indicates the starting time to plot.sorted.line
is TRUE
, it allows long actions to be sorted by starting time.>0
. max_tps
is the maximum time used to build the grid in the plot.
max_tps
is useful when Xsup
is given. If max_tps
is NULL
it is automatically computed.matrix
containing colors.
Colors are automatically computed if colvect
is NULL
.
If group
is not NULL
colvect should have two rows otherwise one.numeric
.
ncolvect
indicates the number of columns of colvect
. Its default setting is dim(X)[1]
.
ncolvect
is considered only if colvect
is NULL
.times
is TRUE
, it incidicates that X
contains data in a time format.times
is TRUE
.dim(X)[2]
. idsubject
indicates the
number of the column of X that contains individuals id numbers.method
global
: The plot of the ViSigrid object returned will not consider the parameter group
and plot indistinctly all individuals.
cut
: In the plot of the ViSigrid object returned each group will be plotted apart within each action line.
join
: In the plot of the ViSigrid object returned groups will be plotted gathered within each action line.
within
: In the plot of the ViSigrid object returned , within each action line, there will be two lines,
as for the method cut
, the difference is that the first line will plot all individuals and
the second one individuals belonging to the group specified in grwithin
.
informer
The parameter informer
allows choosing an indicator. informer
can take three values:
median
: Median and quartiles are calculated for each action, using the function
quantile from the package stats. This is the default value.
mean
: Mean and standard deviation are calculated for each action, using the
functions mean and var from the package stats.
NULL
: no indicators are computed.
When a group is declared indicators are calculated by group if the method cut or within is chosen.
When plotting the ViSigrid
object, indicators for a punctual action are represented by
white circles linked by a line. For long action, only a black line is plotted from
the median (or mean) of the punctal action staring it. The line length represents
the median (or mean) of the long action duration.
Informers are computed directly on the given matrix for punctual action.
And for a long action it is calculated on the difference between the beginning punctual action and the ending one.
tests
and threshold.test
As for the parameter informer, tests are computed on the given
matrix or data.frame X for a punctual action. And for a long action it is calculated on its difference between its beginning and ending punctual actions.
In plot-ViSigrid-method
, results of the tests are represented by a star only when the
resulted p-value is bellow or equal to the parameter threshold.test.
pixel
The parameter pixel represents the number of unit of time under which individuals are aggregated for punctual action in the plot. When the parameter pixel is too small the information represented will be too much aggregated to allow interpretation.
For punctual actions data are aggregated in a matrix $M$ . The number of row of $M$ is the number of action and its number of columns is $[ ( max(X)-t_{0} )/pixel]$.
$M_{i,j}$ contains the number of observations of the $i$-th punctual action (by the order of the ViSibook object) between $t_0 + (j-1)pixel$ included and $t_0 + j*pixel$ excluded.
t_0
The origin of the graphic can be set using the parameter t_0. There is two ways to define it:
x can also has the colunms : GZDebn, GZFin, Repetition, BZBeforeDeb, BZBeforeFin, BZAfterDeb, BZAfterFin, BZLong , BZLtype
intubation
. Classes ViSigrid
and ViSibook
.
The method plot for ViSigrid object plot-ViSigrid-method
for examples.