R/recurrent.marginal.R
count.history.Rd
Counts the number of previous events of two types for recurrent events processes
count.history(
data,
status = "status",
id = "id",
types = 1,
names.count = "Count",
lag = TRUE,
multitype = FALSE,
marks = NULL
)
data-frame
name of status
id
types of the events (code) related to status (multiple values possible)
name of Counts, for example Count1 Count2 when types=c(1,2)
if true counts previously observed, and if lag=FALSE counts up to know
if multitype is true then counts when status "in" types, otherwise counts for each value of type, types=c(1,2)
values related to status ("in" types), counts marks for types, only when multitype=TRUE
data(hfactioncpx12)
hf <- hfactioncpx12
dtable(hf,~status)
#>
#> status
#> 0 1 2
#> 617 1391 124
#>
rr <- count.history(hf,types=1:2,id="id",status="status")
dtable(rr,~"Count*"+status,level=1)
#>
#> Count1
#> 0 1 2 3 4 5 6 7
#> 741 507 319 209 146 97 67 46
#>
#> Count2
#> 0
#> 2132
#>
#> status
#> 0 1 2
#> 617 1391 124
#>