Description Usage Arguments Author(s) References Examples
Simulator for a GEE model.
1 |
vecni |
|
vc |
|
beta |
|
xmat |
|
itypee |
|
itypeb |
Joseph W. McKean
Kloke and McKean (2014), Nonparametrics Using R, Boca Raton: Chapman-Hall.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (vecni, vc, beta, xmat, itypee = 1, itypeb = 1)
{
numc <- length(vecni)
n <- sum(vecni)
center <- rep(0, n)
ind <- rep(0, n)
errs <- rep(0, n)
i1 <- 1
i2 <- 0
for (j in 1:numc) {
if (itypeb == 1) {
bj <- rnorm(1, 0, sqrt(vc[1]))
}
i2 <- i2 + vecni[j]
ni <- vecni[j]
ni2 <- floor(ni/2)
center[i1:i2] <- rep(j, ni)
if (itypee == 1) {
ei <- rnorm(ni, 0, sqrt(vc[2]))
}
errs[i1:i2] <- ei + bj
i1 <- i1 + ni
}
y <- xmat %*% beta + errs
list(y = y, center = center)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.