plotPairs: Plot pairwise probability of co-membership

Description Usage Arguments Examples

View source: R/plotPairs.R

Description

Given co-membership probability input based on postPairs, create a linkage plot colored according to probability range.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
plotPairs(
  dat,
  id_var,
  g_var,
  ls_prob,
  ls_groups = NULL,
  ls_labels = NULL,
  cutPoints = c(0.5, 0.8),
  subTitles = paste(c("All", "Low", "Medium", "High"), "frequencies"),
  allColors = c("darkseagreen", "coral3", "steelblue", "sandybrown"),
  seed = 1,
  thin = 0.1
)

Arguments

dat

Longitudinal data input

id_var

Character of id variable

g_var

Column name in dat containing true group labels in the dataset

ls_prob

List of pairwise probability output of function postPairs

ls_groups

List of "similar" groups as elements of list respective to groups as list names. The co-membership probabilities indicated "similar" groups will be plotted in color allColors, and "dissimilar" groups will be plotted in black

ls_labels

List of group labels to display sequentially on the plot. Default is alphabetically sorted groups

cutPoints

Vector of two cutoff points between 0 and 1 to discretize probabilities into three intervals to indicate three levels of transparency of the curves. Default c(.5,.8)

subTitles

Vector of titles to be labeled for each subplot of random effect scenario

allColors

Colors of the curves under the random effect scenarios. Default c('darkseagreen', 'coral3','steelblue','sandybrown')

seed

Random seed for sampling curves when thin is less than 1

thin

Thinning parameter between 0 and 1. Recommended to set at low value to aid visualization. When thin=1 all curves are shown. Default is 0.1

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
ls_prob <- out_pc$ls_prob
ls_labels <- rep(list(1:4),4)
ls_labels[[4]] <- c(1,3,2,4)
ls_groups <- list(
'1'= c('2','3'),
'2'= c('1','4'),
'3'= c('1','4'),
'4'= c('3','2')
)
plotPairs(DATASET,'ID','Group',ls_prob,ls_groups,ls_labels,thin=.01)

maoyinan/BayesPC documentation built on Dec. 21, 2021, 1:48 p.m.