Skip to contents

write_model_Reg_Nest automatically generates model file according to model_options; This is called within nplcm_fit_Reg_Nest.

Usage

write_model_Reg_Nest(
  Mobs,
  prior,
  cause_list,
  Eti_formula,
  FPR_formula,
  use_measurements,
  ppd = NULL,
  use_jags = FALSE
)

Arguments

Mobs

Measurement data in the form of data_nplcm

prior

Prior specification from model_options

cause_list

A list of latent status names (crucial for building templates; see make_template())

Eti_formula

Etiology regression formula; Check model_options$likelihood$Eti_formula.

FPR_formula

A list of FPR regression formula; check model_options$likelihood$FPR_formula

use_measurements

"BrS", or "SS"

ppd

Default is NULL; set to TRUE for posterior predictive checking

use_jags

Default is FALSE; set to TRUE if want to use JAGS for model fitting.

Value

a long character string to be written into .bug file.

See also

insert_bugfile_chunk_noreg_meas for inserting .bug file chunk for measurements (plug-and-play.R); insert_bugfile_chunk_noreg_etiology for inserting .bug file chunk for distribution of latent status (etiology).

Other model generation functions: write_model_NoReg(), write_model_Reg_NoNest(), write_model_Reg_discrete_predictor_NoNest()