bircpme: Bivariate Random Change Point Mixed Model

View source: R/bircpme.R

bircpmeR Documentation

Bivariate Random Change Point Mixed Model

Description

Bivariate Random Change Point Mixed Model

Usage

bircpme(
  longdata,
  formu,
  covariate = "NULL",
  REadjust = "no",
  gamma = 0.1,
  nbnodes = 10,
  adapt = FALSE,
  param = NULL,
  nproc = 1,
  model = "test",
  link1 = "linear",
  link2 = "linear",
  twostep = FALSE
)

Arguments

longdata

A dataframe containing the variables used in the formula formu

formu

A formula object describing which variables are to be used. The formula has to be of the following form markervar1 + markervar2 ~ scorevar | grouvpar for the function to work.

covariate

An optional string indicating a binary covariate to add on the fixed effects, i.e. intercept, mean slope, difference of slopes and changepoint date. The parameter REadjust indicates how this covariate influences the random effects variance structure. Default to NULL, i.e. no covariates.

REadjust

An optional string value indicating how the random effects variance structure depends on covariate. "no" means that the structure doesn't depend upon covariate. "prop" indicates that the random effects variance structure is proportionnal according to covariate value. "yes" indicates that there is two different random effects variance structures, i.e. one for each level of covariate. Default to "no".

gamma

A numeric parameter indicating how smooth the trajectory is on the changepoint date. Default to 0.1.

nbnodes

A numeric parameter indicating how many nodes are to be used for the gaussian quadrature for numerical integration. Default to 10.

adapt

A boolean indicating whether adaptive gaussian quadrature should be used for numerical integration. Default to FALSE.

param

An optional vector parameter that contains initial parameter for the optimization of the log-likelihood. Default to NULL.

nproc

An optional integer specifying the number of processors for parallelisation of the optimization algorithm. Default to 1.

model

An optional string indicating which formulation of the random changepoint exists. The first is 'test' which is used by the 'testRCPMM' function, the second is 'bw' for the Bacon-Watts formulation of the model, the third is 'isplines' for the I-spline model. When used for estimation purpose, you should either 'bw' or 'isplines' which has better interpretability properties. Default to 'bw'

link1

An optional string indicating which link function is to be used for the first marker. This link function is used to deal with non-gaussian data. With 'link=splines' the model estimates an appropriate I-spline link function 'g' so that 'g(scorevar)' is a gaussian variable. If data is already gaussian, you can chose 'link=linear' so that no link function will be estimated. Default to 'linear'.

link2

Same as link1 but for the second marker. Default to 'linear'.

twostep

An optional boolean to specify if a two-step pseudo adaptive Gaussian quadrature should be used. Currently not working. Default to 'FALSE'.

Value

The output contains several objects : loglik is the value of the log-likelihood at the optimum; fixed contains all fixed parameters estimates, standard errors, CIs, wald test statistic and corresponding pvalue when possible; sdres the estimated residual error; VarEA a matrix containing the estimated random effects covariance matrix of the eight random effects: four for each marker with a general correlation structure between them; optpar the optimal parameters maximizing the log-likelihood; covariate the covariate declared in the function call; REadjust the string indicating how random effects structure is handled as declared in the function call, invhessian the covariance matrix containing all the standard errors and correlations of the parameter estimates;


crsgls/rcpm documentation built on Sept. 28, 2024, 11:38 a.m.