conf.mat.plot {BDgraph}R Documentation

Plot Confusion Matrix

Description

Plot a Confusion Matrix.

Usage

 
conf.mat.plot( pred, actual, cutoff = 0.5, conf.level = 0, margin = 1, 
                          color = c( "#ff83a8", "#83ff9b" ), ... )

Arguments

pred

adjacency matrix corresponding to an estimated graph. It can be an object with S3 class "bdgraph" from function bdgraph. It can be an object of S3 class "ssgraph", from the function ssgraph::ssgraph() of R package ssgraph::ssgraph().

actual

adjacency matrix corresponding to the actual graph structure in which a_{ij}=1 if there is a link between notes i and j, otherwise a_{ij}=0. It can be an object with S3 class "sim" from function bdgraph.sim. It can be an object with S3 class "graph" from function graph.sim. It can be a factor, numeric or character vector of responses (true class), typically encoded with 0 (controls) and 1 (cases). Only two classes can be used in a ROC curve.

cutoff

cutoff value for the case that pred is vector of probabilites. The default is 0.5.

conf.level

confidence level used for the confidence rings on the odds ratios. Must be a single nonnegative number less than 1; if set to 0 (the default), confidence rings are suppressed.

margin

numeric vector with the margins to equate. Must be one of 1 (the default), 2, or c(1, 2), which corresponds to standardizing the row, column, or both margins in each 2 by 2 table. Only used if std equals "margins".

color

vector of length 2 specifying the colors to use for the smaller and larger diagonals of each 2 by 2 table.

...

options to be passed to fourfoldplot.

Author(s)

Reza Mohammadi a.mohammadi@uva.nl

See Also

conf.mat, compare, roc, bdgraph

Examples

## Not run: 
set.seed( 100 )

# Generating multivariate normal data from a 'random' graph
data.sim <- bdgraph.sim( n = 50, p = 6, size = 7, vis = TRUE )

# Running sampling algorithm based on GGMs 
sample.ggm <- bdgraph( data = data.sim, method = "ggm", iter = 10000 )

# Confusion Matrix for GGM method
conf.mat.plot( pred = sample.ggm, actual = data.sim )

## End(Not run)

[Package BDgraph version 2.72 Index]