-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.R
More file actions
43 lines (33 loc) · 798 Bytes
/
Copy pathtest.R
File metadata and controls
43 lines (33 loc) · 798 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
library(HazReg)
set.seed(1234)
des1 <- cbind(rnorm(10),rnorm(10))
des2 <- cbind(rnorm(10),rnorm(10))
des3 <- cbind(rnorm(10),rnorm(10))
des4 <- cbind(rnorm(10),rnorm(10))
des5 <- cbind(rnorm(10),rnorm(10))
des6 <- cbind(rnorm(10),rnorm(10))
des_list <- list(des1, des2, des3, des4, des5, des6)
time <- c(0, 1, 2, 3, 4, 5)
n <- nrow(des1) # number of individuals
p <- ncol(des1) # number of covariates
df <- do.call(
rbind,
lapply(seq_along(time), function(k) {
data.frame(
ID = 1:n,
time = time[k],
des1 = des_list[[k]][, 1],
des2 = des_list[[k]][, 2]
)
})
)
beta <- c(0.1, 0.2)
ae0 <- 0
be0 <- 1
theta = c(ae0,be0)
npar = 2
SPred_TVC(df = df,
beta = beta,
theta = theta,
chfun = chlnorm,
hstr = "PH")