Description Usage Arguments Value Examples

View source: R/efficiency_criterions.R

Function to calculate the DB-error given a design, and parameter values.

1 |

`par.draws` |
Numeric matrix in which each row is a draw from a multivariate parameter distribution. |

`des` |
A design matrix in which each row is an alternative. |

`n.alts` |
Numeric value indicating the number of alternatives per choice set. |

`weights` |
A numeric vector containing weights of |

`mean` |
A logical value indicating whether the mean (DB) error should be returned or not. Default = TRUE. |

Numeric value indicating the DB-error of the design given the parameter draws.

1 2 3 4 5 6 7 8 9 10 11 | ```
des <- example_design
mu = c(-1, -1.5, -1, -1.5, 0.5, 1)
Sigma = diag(length(mu))
par.draws <- MASS::mvrnorm(100, mu = mu, Sigma = Sigma)
n.alts = 2
DBerr(par.draws = par.draws, des = des, n.alts = n.alts)
mu = c(-0.5, -1, -0.5, -1, 0.5, 1)
Sigma = diag(length(mu))
par.draws <- MASS::mvrnorm(100, mu = mu, Sigma = Sigma)
DBerr(par.draws = par.draws, des = des, n.alts = n.alts)
``` |

```
Loading required package: shiny
[1] 3.261682
[1] 3.013401
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.