# NOT RUN {
data(hue)
## Second degree polynomial model with random intercept, slope and
## quadratic term
fm1 <- lcc(data = hue, subject = "Fruit", resp = "H_mean",
method = "Method", time = "Time", qf = 2, qr = 2)
print(fm1)
summary(fm1)
summary(fm1, type="model")
lccPlot(fm1)
## Estimating longitudinal Pearson correlation and longitudinal
#accuracy
fm2 <- update(fm1, components = TRUE)
summary(fm2)
lccPlot(fm2)
# }
# NOT RUN {
## A grid of points as the Time variable for prediction
fm3 <- update(fm2, time_lcc = list(from = min(hue$Time),
to = max(hue$Time), n=40))
summary(fm3)
lccPlot(fm3)
# }
# NOT RUN {
## Including an exponential variance function using time as a
#covariate.
fm4 <- update(fm2,time_lcc = list(from = min(hue$Time),
to = max(hue$Time), n=30), var.class=varExp,
weights.form="time")
summary(fm4, type="model")
fitted(fm4)
fitted(fm4, type = "lpc")
fitted(fm4, type = "la")
lccPlot(fm4)
lccPlot(fm4, type = "lpc")
lccPlot(fm4, type = "la")
# }
# NOT RUN {
## Non-parametric confidence interval with 500 bootstrap samples
fm5 <- update(fm1, ci = TRUE, nboot = 500)
summary(fm5)
lccPlot(fm5)
# }
# NOT RUN {
## Considering three methods of color evaluation
# }
# NOT RUN {
data(simulated_hue)
attach(simulated_hue)
fm6 <- lcc(data = simulated_hue, subject = "Fruit",
resp = "Hue", method = "Method", time = "Time",
qf = 2, qr = 1, components = TRUE,
time_lcc = list(n=50, from=min(Time), to=max(Time)))
summary(fm6)
lccPlot(fm6)
detach(simulated_hue)
# }
# NOT RUN {
## Including an additional covariate in the linear predictor
## (randomized block design)
# }
# NOT RUN {
data(simulated_hue_block)
attach(simulated_hue_block)
fm7 <- lcc(data = simulated_hue_block, subject = "Fruit",
resp = "Hue", method = "Method",time = "Time",
qf = 2, qr = 1, components = TRUE, covar = c("Block"),
time_lcc = list(n=50, from=min(Time), to=max(Time)))
summary(fm7)
lccPlot(fm7)
detach(simulated_hue_block)
# }
# NOT RUN {
## Testing interaction effect between time and method
fm8 <- update(fm1, interaction = FALSE)
anova(fm1, fm8)
# }
# NOT RUN {
## Using parallel computing with 3 cores, and a set.seed(123)
to verify model reproducibility.
set.seed(123)
fm9 <- lcc(data = hue, subject = "Fruit", resp = "H_mean",
method = "Method", time = "Time", qf = 2, qr = 2,
ci=TRUE, nboot = 30, numCore = 3)
# Repeating same model with same set seed.
set.seed(123)
fm10 <- lcc(data = hue, subject = "Fruit", resp = "H_mean",
method = "Method", time = "Time", qf = 2, qr = 2,
ci=TRUE, nboot = 30, numCore = 3)
## Verifying if both fitted values and confidence intervals
are identical
identical(fm9$Summary.lcc$fitted,fm10$Summary.lcc$fitted)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab