View source: R/convert_bayesian_to_frequentist.R

convert_bayesian_as_frequentist | R Documentation |

Refit Bayesian model as frequentist. Can be useful for comparisons.

```
convert_bayesian_as_frequentist(model, data = NULL, REML = TRUE)
bayesian_as_frequentist(model, data = NULL, REML = TRUE)
```

`model` |
A Bayesian model. |

`data` |
Data used by the model. If |

`REML` |
For mixed effects, should models be estimated using
restricted maximum likelihood (REML) ( |

```
# Rstanarm ----------------------
# Simple regressions
model <- rstanarm::stan_glm(Sepal.Length ~ Species,
data = iris, chains = 2, refresh = 0
)
bayesian_as_frequentist(model)
model <- rstanarm::stan_glm(vs ~ mpg,
family = "binomial",
data = mtcars, chains = 2, refresh = 0
)
bayesian_as_frequentist(model)
# Mixed models
model <- rstanarm::stan_glmer(
Sepal.Length ~ Petal.Length + (1 | Species),
data = iris, chains = 2, refresh = 0
)
bayesian_as_frequentist(model)
model <- rstanarm::stan_glmer(vs ~ mpg + (1 | cyl),
family = "binomial",
data = mtcars, chains = 2, refresh = 0
)
bayesian_as_frequentist(model)
```

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.