Running examples in ‘msSurv-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: msSurv
> ### Title: Nonparametric Estimation for Multistate Models
> ### Aliases: msSurv
> 
> ### ** Examples
> 
> ## 3-state illness-death multistate model (no left-truncation)
> 
> ## Row data for 3 individuals
> ## Data in the form "id", "start", "stop", "start.stage", "end.stage"
> p1  <- c(1,0,0.21,1,3)
> p2  <- c(2,0,0.799,1,2)
> p22 <- c(2,0.799,1.577,2,3)
> p3  <- c(3,0,0.199,1,0)
> 
> ## Combining data into a matrix
> ex1 <- rbind(p1,p2,p22,p3)
> colnames(ex1) <- c("id", "start", "stop", "start.stage", "end.stage")
> ex1 <- data.frame(id=ex1[,1], start=ex1[,2], stop=ex1[,3],
+                   start.stage=ex1[,4], end.stage=ex1[,5])
> 
> 
> ## Inputting nodes & edges of the tree structure
> Nodes <- c("1","2","3") # states in MSM
> Edges <- list("1"=list(edges=c("2","3")),"2"=list(edges=c("3")),
+            "3"=list(edges=NULL)) ## allowed transitions between states
>                                  ## edges=NULL implies terminal node
> 
> ## Specifying tree
> treeobj <- new("graphNEL", nodes=Nodes, edgeL=Edges,
+                 edgemode="directed")
> 
> ans1 <- msSurv(ex1, treeobj)

Entry distributions calculated for states 3 .

Exit distributions calculated for states 1 .
> 
> ## printing msSurv object 'ans1'
> print(ans1)
An object of class 'msSurv'.

Allowable States: 1 2 3

The multistate model has 2 transient state(s) and 1 absorbing state(s).

Number of timepoints with transitions: 3

Allowable transitions: 1->2, 1->3, 2->3

For a listing of available slots and methods see 'class?msSurv'

See also: 
 'SOPt' for calculation of state occupation probabilities 
 'Pst' for calculation of transition probabilities and 
 'EntryExit' for calculation of state entry / exit distributions. 
> 
> ## summary for msSurv object
> summary(ans1)
State Occupation Information: 
 
State  1 
  time estimate variance lower.ci upper.ci
 0.210      0.5    0.125        0        1
 0.210      0.5    0.125        0        1
 0.799      0.0    0.000        0        0
 0.799      0.0    0.000        0        0
 1.577      0.0    0.000        0        0

State  2 
  time estimate variance lower.ci upper.ci
 0.210      0.0    0.000        0        0
 0.210      0.0    0.000        0        0
 0.799      0.5    0.125        0        1
 0.799      0.5    0.125        0        1
 1.577      0.0    0.000        0        0

State  3 
  time estimate variance lower.ci upper.ci
 0.210      0.5    0.125        0        1
 0.210      0.5    0.125        0        1
 0.799      0.5    0.125        0        1
 0.799      0.5    0.125        0        1
 1.577      1.0    0.000        1        1

State Entry Distribution Information: 
 
State  3 
  time entry.sub entry.norm
 0.210       0.5        0.5
 0.210       0.5        0.5
 0.799       0.5        0.5
 0.799       0.5        0.5
 1.577       1.0        1.0

State Exit Distribution Information: 
 
State  1 
  time exit.sub exit.norm
 0.210      0.5       0.5
 0.210      0.5       0.5
 0.799      1.0       1.0
 0.799      1.0       1.0
 1.577      1.0       1.0

Transition Probability Information: 
 
Transition 1 -> 1 
  time estimate variance lower.ci upper.ci n.risk n.remain
 0.210      0.5    0.125        0        1      2        1
 0.210      0.5    0.125        0        1      2        1
 0.799      0.0    0.000        0        0      1        0
 0.799      0.0    0.000        0        0      1        0
 1.577      0.0    0.000        0        0      0        0

Transition 1 -> 2 
  time estimate variance lower.ci upper.ci n.risk n.event
 0.210      0.0    0.000        0        0      2       0
 0.210      0.0    0.000        0        0      2       0
 0.799      0.5    0.125        0        1      1       1
 0.799      0.5    0.125        0        1      1       1
 1.577      0.0    0.000        0        0      0       0

Transition 1 -> 3 
  time estimate variance lower.ci upper.ci n.risk n.event
 0.210      0.5    0.125        0        1      2       1
 0.210      0.5    0.125        0        1      2       1
 0.799      0.5    0.125        0        1      1       0
 0.799      0.5    0.125        0        1      1       0
 1.577      1.0    0.000        1        1      0       0

Transition 2 -> 2 
  time estimate variance lower.ci upper.ci n.risk n.remain
 0.210        1        0        1        1      0        0
 0.210        1        0        1        1      0        0
 0.799        1        0        1        1      0        0
 0.799        1        0        1        1      0        0
 1.577        0        0        0        0      1        0

Transition 2 -> 3 
  time estimate variance lower.ci upper.ci n.risk n.event
 0.210        0        0        0        0      0       0
 0.210        0        0        0        0      0       0
 0.799        0        0        0        0      0       0
 0.799        0        0        0        0      0       0
 1.577        1        0        1        1      1       1

> 
> ## plotting msSurv object 'ans1'
> plot(ans1, plot.type="stateocc")
> plot(ans1, plot.type="stateocc", states=c("1", "2"))
> plot(ans1, plot.type="transprob")
> plot(ans1, plot.type="entry.norm")
Warning: 'Fnorm.var'  is NULL and therefore CIs not plotted. 
> plot(ans1, plot.type="exit.norm")
Warning: 'Gnorm.var'  is NULL and therefore CIs not plotted. 
> 
> ## 3-state illness-death multistate model WITH left-truncation
> 
> ## Row data for 3 individuals
> ## Data in the form "id", "start", "stop", "start.stage", "end.stage"
> 
> p1  <- c(1,  0.383,  1.400,  1,  0)
> p2  <- c(2,  0.698,  0.999,  1,  2)
> p22 <- c(2,  0.999,  1.180,  2,  0)
> p3  <- c(3,  0.249,  0.391,  1,  2)
> p32 <- c(3,  0.391,  0.513,  2,  3)
> 
> ex2 <- rbind(p1, p2, p22, p3, p32)
> colnames(ex2) <- c("id",  "start",  "stop",  "start.stage",  "end.stage")
> ex2 <- data.frame(ex2)
> 
> ## inputting nodes & edgest of the tree structure
> Nodes <- c("1", "2", "3")
> Edges <- list("1"=list(edges=c("2", "3")), "2"=list(edges=c("3")), "3"=list(edges=NULL))
> treeobj <- new("graphNEL", nodes=Nodes, edgeL=Edges, edgemode="directed")
> 
> ans2 <- msSurv(ex2, treeobj, LT=TRUE)
Error in nrow(Data) : object 'Data' not found
Calls: msSurv ... by.data.frame -> structure -> eval -> eval -> tapply -> nrow
Execution halted