posterior_cases {CNPBayes} | R Documentation

## Calculate posterior proportion of cases by component

### Description

Calculate posterior proportion of cases by component

### Usage

    posterior_cases(model, case_control, alpha = 1, beta = 1)

### Arguments

`model` | An instance of a `MixtureModel`-derived class.
`case_control` | A vector of 1's and 0's where a 1 indicates a case and a 0 a control
`alpha` | prior alpha for the beta
`beta` | prior beta for the beta

### Value

A matrix of dimension S (MCMC iterations) by K (number of components) where each element i,j indicates the posterior proportion of cases at an iteration and component

### Examples

    ## Not run:
         # generate random case control status
         case_control <- rbinom(length(y(SingleBatchModelExample)), 1, 0.5)
         case_control_posterior <- posterior_cases(SingleBatchModelExample,
                                                   case_control)

    ## End(Not run)

[Package CNPBayes version 1.13.5 Index]