convert-methods {prevalence}R Documentation

Methods for Function as.matrix in Package prevalence

Description

Convert objects of class prev to matrix

Usage

## S4 method for signature 'prev'
as.matrix(x, iters = FALSE, chains = FALSE)

Arguments

x

An object of class prev

iters

Logical flag, indicating whether a column should be added for iteration number; defaults to FALSE

chains

Logical flag, indicating whether a column should be added for chain number; defaults to FALSE

Methods

signature(x = "prev")

Convert objects of class prev to matrix

See Also

prev-class

Examples

## Not run: 

## Taenia solium cysticercosis 1-test model
cysti <-
truePrev(x = 142, n = 742,
         SE = ~dunif(0.60, 1.00), SP = ~dunif(0.75, 1.00))

head(as.matrix(cysti))


## Campylobacter 2-test model
campy <-
truePrevMulti(
  x = c(113, 46, 156, 341),
  n = 656,
  prior = {
    theta[1] ~ dunif(0.45, 0.80)
    theta[2] ~ dunif(0.24, 0.50)
    theta[3] <- 1
    theta[4] ~ dbeta(30, 12)
    theta[5] ~ dbeta(1, 1)
    theta[6] <- 1
    theta[7] <- 1
  }
)

head(as.matrix(campy, iters = TRUE, chains = TRUE))

## End(Not run)

[Package prevalence version 0.4.1 Index]