Learn R Programming

ProfileGLMM (version 1.1.0)

profileGLMM_preprocess: Preprocess the data from a list describing the profile LMM model

Description

Preprocess the data from a list describing the profile LMM model

Usage

profileGLMM_preprocess(
  regType,
  covList,
  dataframe,
  nC,
  intercept = list(FE = TRUE, RE = TRUE, Lat = TRUE)
)

Value

An object of class pglmm_data. This is a list with

  • d dictionary with [XFE,XRE,XLat,UCont,UCat,ZRE] design matrices

  • [[params]] list of the parameters of the data

    • n int nb of obs

    • qFE int, number of covariates of FE

    • nRE int, number of stat units of RE

    • qRE int, number of covariates of RE

    • qLat int, number of covariates interacting with the latent clusters

    • qUCont int, number of continuous clustering covariates

    • qUCat int, number of categorical clustering covariates

    • nC int, maximal number of clusters

  • prior a list with all the specification of the default prior used

  • theta a list with a default set of parameters to start the chain, drawn from the prior

  • regType an int. Currently 0 for linear, 1 for probit

Arguments

regType

A string, current possibilities: linear or probit

covList

A list with fields:

  • FE fixed effect covariates names/index in dataframe

  • RE random effect covariates names/index in dataframe

  • Lat latent effect covariates names/index in dataframe

  • Assign assignement variables list with fields:

    • Cont Continuous variables names/index in dataframe

    • Cat Categorical variables names/index in dataframe

  • REunit statistical unit of the RE colomn name/index

  • Y outcome (Continuous)

dataframe

A dataframe containing outcome anf covariates

nC

int: maximal number of cluster for the DP truncation

intercept

(optionnal): A list with fields

  • RE bool indicating if FE have an intercept

  • FE bool indicating if RE have an intercept

  • Lat bool indicating if Latent have an intercept

Examples

Run this code
data("exposure_data")
exp_data = exposure_data$df
theta0 = exposure_data$theta0
covList = {}
covList$FE = c('X')
covList$RE = c('t')
covList$REunit = c('indiv')

covList$Lat = c('X')

covList$Assign$Cont = c('Exp1','Exp2')
covList$Assign$Cat = NULL

covList$Y = c('Y')
dataProfile = profileGLMM_preprocess(regType = 'linear',
                                     covList = covList,
                                     dataframe = exp_data,
                                     nC = 30,
                                     intercept = list(FE = TRUE, RE = FALSE, Lat = TRUE))

Run the code above in your browser using DataLab