Description Usage Arguments Value Examples
View source: R/Gaussian_PPL_src.R
Generate input data for BivPPL
1 |
N |
Sample size for alternating recurrent events, or number of clusters for other bivariate clustered events |
beta1 |
Regression parameters for event type 1. |
beta2 |
Regression parameters for event type 2. |
theta |
A vector of 3 entries in the variance-covariance matrix of the bivariate frailty vector. The first two are variance values for the first and second event types, and the third is the covariance. |
c |
Maximum censoring time. |
Ctype |
logical; if TRUE, fixed censoring time at c; or if FALSE, randomly draw from a uniform(0,c). |
const_cov |
logical; if TRUE, the covariates are not updated across the event times. |
same_cov |
logical; if TRUE, the covariates are shared between two event types. |
a list object of data that recorded all the covariates, event times, indicators, and the true frailty values.
x |
a list of follow-up time for the first event type |
y |
a list of follow-up time for the second event type |
z1 |
a list of covariats for event type 1 |
z2 |
a list of covariats for event type 2 |
delta1 |
a list of type 1 event status |
delta1 |
a list of type 2 event status |
r |
true values of the bivariate frailties |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | set.seed(100)
N<-100 # number of clusters
beta1 <- c(0.5,-0.3,0.5) # regression parameters for event type 1
beta2 <- c(0.8,-0.2,0.3) # regression parameters for event type 2
beta <- c(beta1,beta2)
theta <- c(0.25,0.25,-0.125) # variance-covariance matrix for the bivariate frailty (denoted as D), it is a vector (D[1,1],D[2,2], D[1,2])
lambda01 <- 1
lambda02 <- 1
cen <- 10 # maximum censoring time
centype <- TRUE # fixed censoring time at cen
data <- gen.data(N,beta1,beta2,theta,lambda01,lambda02,c=cen,Ctype=centype)
ptm<-proc.time()
res <- BivPPL(data)
proc.time() - ptm
res$beta_hat
res$beta_ASE
res$D_hat
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.