## Not run:
# ## example using the height data provided in the package
# ## there are 7 observation times (age in years):
# ## WARNING: cv.growth is time-consuming. This example uses only part of the data.
# data(height_data);
# ht = height_data[1:100,];
# tobs=c(0,1/3,2/3,1,3,4,7);
# cvg=cv.growth(ht, tobs, 100, 21, 1, 5, 2);
#
# ## Plot of the cross validation error as a function of sigma:
# plot(cvg$sigmavec, cvg$CVer, xlab="Sigma", ylab="Cross validation error");
#
# ## Value of sigma that minimizes the cross validation error:
# sigmaopt=cvg$sigmavec[which(cvg$CVer==min(cvg$CVer))];
# ## End(Not run)
Run the code above in your browser using DataLab