simBKMRDLM | R Documentation |
Simulate data for BKMR-DLM.
simBKMRDLM(n = 200, scenario = "A", sd = 1, seed, dta)
n |
Number of observations. |
scenario |
Simulation scenario (A, B, C, D, E, F). |
sd |
Error standard deviation. |
seed |
An optional seed. |
dta |
A list with data to use. The elements should be X, a list of exposure matrices, and Z a matrix of covariates. If not data is provided then data will be simulated automatically. |
A list containing simulated data
library(regimes)
#simulate data from scenario A
dat <- simBKMRDLM(n = 200, scenario="A", sd=1, seed=1234)
# Estimate model
# This may take a few minutes
# Increase iterations for a real analysis
fit <- bkmrdlm(y=dat$y,
x=dat$x,
z=dat$z,
niter=100,
gaussian=FALSE,
polydegree=2)
summary(fit)
plot(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.