Description Usage Arguments Value See Also Examples
Reconstruct data into a regular longitudinal format as a refined dataset and do joint modelling for this refined data with ordinal outcome.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
long_data |
Data matrix for longitudinal in long format. The time variable should be labeled 'time'. |
surv_data |
Data matrix for competing risks data. Each subject has one row of observation (as opposed to the long_data). First and second column should be the observed event time and censoring indicator, respectively. The coding for the censoring indicator is as follows: 0 - censored events, 1 - risk 1, 2 - risk 2. Two competing risks are assumed. |
out |
Column name for outcome variable in long_data. |
FE |
Vector of column names that correspond to the fixed effects in long_data. If missing, then all columns except for the outcome and ID columns will be considered. |
RE |
Types/Vector of random effects in long_data. The available type are "intercept", "linear", "quadratic" (time-related random effect specification) or other covariates in the input dataset. |
NP |
Vector of column names that correspond to the non-proportional odds covariates. It won't run the model if NP is not specified. |
ID |
Column name for subject ID number in long_data. |
cate |
Vector of categorical variables in long_data. |
intcpt |
Specify either 0 or 1. Default is set as 1. 0 means no intercept in random effect. |
quad.points |
Number of quadrature points used in the EM procedure. Default is 20. Must be an even number. Larger values means higher accuracy but more time-consuming. |
max.iter |
Max iterations. Default is 10000. |
quiet |
Logical. Print progress of function. Default is TRUE. |
do.trace |
Logical. Print the parameter estimates during the iterations. Default is FALSE. |
Object of class JMcmprsk
with elements
vcmatrix | The variance-covariance matrix for all the parameters. The parameters are in the order: β, σ^2, γ, ν, and Σ. The elements in Σ are output in the order along the main diagonal line, then the second main diagonal line, and so on. |
betas | The point estimates of β. |
se_betas | The standard error estimate of β. |
gamma_matrix | The point estimate of γ. |
se_gamma_matrix | The standard error estimate of γ. |
v_estimate | The point estimate of ν. |
se_v_estimate | The standard error estimate of ν. |
sigma2_val | The point estimate of σ^2. |
se_sigma2_val | The standard error estimate of σ^2. |
sigma_matrix | The point estimate of Σ (only the upper triangle portion of the matrix is output). |
se_sigma | The standard error estimate of Σ.The standard errors are given in this order: main diagonal, the second main diagonal, and so on. |
loglike | Log Likelihood. |
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 | require(JMcmprsk)
set.seed(123)
data(ninds)
yread <- ninds[, c(1, 2:14)]
cread <- ninds[, c(1, 15, 16, 6, 10:14)]
cread <- unique(cread)
# Please note only those variables that will appear in the model can be included
res1 <- jmo(yread, cread, out = "Y",
FE = c("group", "time3", "time6", "time12", "mrkprior",
"smlves", "lvORcs", "smlves.group", "lvORcs.group"),
cate = NULL,RE = "intercept", NP = c("smlves", "lvORcs"),
ID = "ID",intcpt = 1, quad.points = 6,
max.iter = 1000, quiet = FALSE, do.trace = FALSE)
res1
## Not run:
#Create two categorical variables and add them into yread
ID <- cread$ID
set.seed(100)
sex <- sample(c("Female", "Male"), nrow(cread), replace = T)
race <- sample(c("White", "Black", "Asian", "Hispanic"), nrow(cread), replace = T)
cate_var <- data.frame(ID, sex, race)
if (require(dplyr)) {
yread <- dplyr::left_join(yread, cate_var, by = "ID")
}
res2 <- jmo(yread, cread, out = "Y",
FE = c("group", "time3", "time6", "time12", "mrkprior",
"smlves", "lvORcs", "smlves.group", "lvORcs.group"), cate = c("race", "sex"),
RE = "intercept", NP = c("smlves", "lvORcs", "race", "sex"), ID = "ID",intcpt = 1,
quad.points = 20, max.iter = 10000, quiet = FALSE, do.trace = FALSE)
res2
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.