Description Usage Arguments Value Author(s) References Examples
getAveraging(des) converts a design (either a vector or a matrix) into averaging matrix notation (from the paper). For a response vector Y, (B Y)[t] is the mean of all responses corresponding to the treatment at time t, and (B-G)Y [t] is the averaged-removed treatment mean.
1 | getAveraging(des)
|
des |
Either a vector or a matrix representation of design (see designVec2Mat and designMat2Vec). |
A list with components
m |
The number of treatments |
ns |
An m-length vector with the number of repeats for each treatment. For balanced designs with n repeats, ns=rep(n,m) |
B |
The averaging matrix according to the design |
G |
1/T for T the number of measurements |
Yuval Benjamini
Benjamini and Yu (2013).
1 2 3 4 5 6 7 8 9 10 | data(design_vec)
design_avg = getAveraging(design_vec)
rand_resp = rnorm(length(design_vec))
global_mean = mean(rand_resp[design_vec != 0 ])
first_treatment_mean= mean(rand_resp[design_vec == design_vec[1]])
cat((design_avg$B %*% rand_resp)[1], first_treatment_mean )
cat(((design_avg$B-design_avg$G) %*% rand_resp)[1], first_treatment_mean- global_mean)
|
-0.1578266 -0.1578266-0.1370588 -0.1370588
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.