GetMeanCI | R Documentation |
Note that bootstrap pointwise confidence intervals do not work for sparsely observed data.
GetMeanCI(Ly, Lt, level = 0.95, R = 999, optns = list())
Ly |
A list of n vectors containing the observed values for each individual.
Missing values specified by |
Lt |
A list of n vectors containing the observation time points for each
individual corresponding to each element in |
level |
A number taking values in [0,1] determing the confidence level. Default: 0.95. |
R |
An integer holding the number of bootstrap replicates. Default: 999. |
optns |
A list of options; see |
A list of two elements:
CI |
A data frame holding three variables: |
level |
The confidence level of the CIs |
.
n <- 30
tgrid <- seq(0,1,length.out=21)
phi1 <- function(t) sqrt(2)*sin(2*pi*t)
phi2 <- function(t) sqrt(2)*sin(4*pi*t)
Lt <- rep(list(tgrid), n)
Ly <- lapply(1:n, function(i){
tgrid + rnorm(1,0,2) * phi1(tgrid) + rnorm(1,0,0.5) * phi2(tgrid) + rnorm(1,0,0.01)
})
res <- GetMeanCI(Lt = Lt, Ly = Ly, level = 0.9)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.