checkCOMPASSConvergence: Check the convergence of multiple COMPASS models fit with...

Description Usage Arguments Value Note Examples

View source: R/Rhat.R

Description

Computes Rhat for all nsubjects x nsubsets parameters across the list of models, treated as separate chains. Flags cell populations and subjects with Rhat > 1.01. The most frequently flagged population is passed for further diagnostis to compute Rhat between all pairs of models and to try and identify the model or models that are outliers. The outliers are removed and a list of good models is returned.

Usage

1
checkCOMPASSConvergence(mlist, ncores = 1)

Arguments

mlist

A list of COMPASSResult models. Each should be fit to the same data, but with different seeds.

ncores

The number of cores to use, if supported on the system.

Value

A list of COMPASSResult models that are consistent / have converged.

Note

Uses foreach and doMC, so it won't work on windows.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
data(COMPASS)
set.seed(100)
fit <- COMPASS(CC,
  category_filter=NULL,
  treatment=trt == "Treatment",
  control=trt == "Control",
  verbose=FALSE,
  iterations=100 ## set higher for a real analysis
)
set.seed(200)
fit2 <- COMPASS(CC,
  category_filter=NULL,
  treatment=trt == "Treatment",
  control=trt == "Control",
  verbose=FALSE,
  iterations=100 ## set higher for a real analysis
)
checkCOMPASSConvergence(list(fit,fit2))

COMPASS documentation built on Nov. 8, 2020, 8:05 p.m.