1 |
x |
|
x.col |
|
y.col |
|
s.id |
|
grp.id |
|
regfun |
|
MAR |
|
tr |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ##---- 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 (x, x.col, y.col, s.id, grp.id, regfun = tsreg, MAR = TRUE,
tr = 0.2)
{
m = matsplit(x, grp.id)
g1 = longreg(m$m1, x.col, y.col, s.id, regfun)$est.S
g2 = longreg(m$m2, x.col, y.col, s.id, regfun)$est.S
res = list()
if (MAR) {
for (iv in 1:ncol(g1)) res[[iv]] = yuen(g1[, iv], g2[,
iv], tr = tr)
}
if (!MAR)
res = smean2(g1, g2)
res
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.