export | R Documentation |
The function export()
allows for exporting model estimates in CSV format.
export(x, file, type = "all", ...)
x |
An object of class |
file |
A character string indicating the path (if different from the working directory) and filename of the CSV to be created. It should end with .csv. |
type |
An option between |
... |
Additional arguments of |
A CSV file is created in the working directory, or at the given path, exporting the estimates_fitsae
object given as input.
extract
to produce the input object and write.csv
.
## Not run:
library(tipsae)
# loading toy dataset
data("emilia_cs")
# fitting a model
fit_beta <- fit_sae(formula_fixed = hcr ~ x, data = emilia_cs, domains = "id",
type_disp = "var", disp_direct = "vars", domain_size = "n",
# MCMC setting to obtain a fast example. Remove next line for reliable results.
chains = 1, iter = 150, seed = 0)
# check model diagnostics
summ_beta <- summary(fit_beta)
# extract model estimates
HB_estimates <- extract(summ_beta)
# export model estimates
export(HB_estimates, file = "results.csv", type = "all")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.