simulate.sklarsomega {sklarsomega} | R Documentation |
Simulate a Sklar's Omega dataset(s).
Description
Simulate a Sklar's Omega dataset(s).
Usage
## S3 method for class 'sklarsomega'
simulate(object, nsim = 1, seed = NULL, ...)
Arguments
object |
a fitted model object. |
nsim |
number of datasets to simulate. Defaults to 1. |
seed |
either |
... |
additional arguments. |
Details
This function simulates one or more responses distributed according to the fitted model.
Value
A data frame having nsim
columns, each of which contains a simulated response vector. Said data frame has a "seed"
attribute, which takes the value of the seed
argument or the value of .Random.seed
.
Examples
# Fit a subset of the cartilage data, assuming a Laplace marginal distribution.
data(cartilage)
data.cart = as.matrix(cartilage)[1:100, ]
colnames(data.cart) = c("c.1.1", "c.2.1")
fit.lap = sklars.omega(data.cart, level = "balance", confint = "none",
control = list(dist = "laplace"))
summary(fit.lap)
# Simulate three datasets from the fitted model, and then display the
# head of the first dataset in matrix form.
sim = simulate(fit.lap, nsim = 3, seed = 42)
data.sim = t(fit.lap$data)
data.sim[! is.na(data.sim)] = sim[, 1]
data.sim = t(data.sim)
head(data.sim)
[Package sklarsomega version 3.0-2 Index]