get_pEti_samp_reg: get etiology samples by names (no regression)

Description Usage Arguments Value

View source: R/plot-etiology-side-by-side.R

Description

get etiology samples by names (no regression)

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
get_pEti_samp_reg(
  DIR_NPLCM,
  model_options,
  stratum_bool = NULL,
  pEti_subject = FALSE,
  reg_param = FALSE,
  truth = NULL,
  return_metric = FALSE,
  RES_NPLCM = NULL
)

Arguments

DIR_NPLCM

File path to the folder containing posterior samples

model_options

See nplcm()

stratum_bool

a vector of TRUE/FALSE with TRUE indicating the rows of subjects to include

pEti_subject

TRUE for getting individual specific samples; Default to FALSE

reg_param

TRUE for getting regression parameters; Default to FALSE

truth

a list of truths computed from true parameters in simulations; elements: Eti, FPR, PR_case,TPR; All default to NULL in real data analyses. Currently only works for one slice of bronze-standard measurements (in a non-nested model).

  • Eti matrix of # of rows = # of subjects, # columns: length(cause_list) for Eti

  • FPR matrix of # of rows = # of subjects, # columns: ncol(data_nplcm$Mobs$MBS$MBS1)

  • PR_case matrix of # of rows = # of subjects, # columns: ncol(data_nplcm$Mobs$MBS$MBS1)

  • TPR a vector of length identical to PR_case

return_metric

TRUE for showing overall mean etiology, quantiles, s.d., and if truth$Eti is supplied, coverage, bias, truth and integrated mean squared errors (IMSE).

RES_NPLCM

pre-read res_nplcm; default to NULL to save time.

Value

A list:

pEti_mat: a matrix of posterior samples (iteration by cause); overall etiology latent_nm: a vector of character strings representing the names of the causes pEti_subject: an array of individual specific etiology; cause by subject by iteration betaEti: an array of samples of the etiology regression parameters; coefficient by cause by iteration


oslerinhealth/baker documentation built on May 22, 2021, 12:05 p.m.