label_switch_2stage {COMBO} | R Documentation |

## Fix Label Switching in MCMC Results from a Binary Outcome Misclassification Model

### Description

Fix Label Switching in MCMC Results from a Binary Outcome Misclassification Model

### Usage

```
label_switch_2stage(chain_matrix, dim_x, dim_z, dim_v, n_cat)
```

### Arguments

`chain_matrix` |
A numeric matrix containing the posterior samples for all
parameters in a given MCMC chain. |

`dim_x` |
An integer specifying the number of columns of the design matrix of the true outcome mechanism, |

`dim_z` |
An integer specifying the number of columns of the design matrix of the first-stage observation mechanism, |

`dim_v` |
An integer specifying the number of columns of the design matrix of the second-stage observation mechanism, |

`n_cat` |
An integer specifying the number of categorical values that the true outcome, |

### Value

`label_switch_2stage`

returns a named matrix of MCMC posterior samples for
all parameters after performing label switching according the following pattern:
all `\beta`

terms are multiplied by -1, all `\gamma`

and `\delta`

terms are "swapped"
with the opposite `j`

index.

*COMBO*version 1.1.0 Index]