## Not run:
# ## example using the height data provided in the package
# ## (after first running growth to obtain the output g):
# ## suppose a new subject has 5 observation times (including 0 and 7)
# data(height_data);
# tobs=c(0,1/3,2/3,1,3,4,7);
# d=200;
# sigma=1;
# g=growth(height_data,tobs,sigma,d);
#
# newtobs=c(0, 2, 3, 5, 7);
# newdata=t(as.vector(c(50,70,87,100,115)));
# ng=new.growth(newdata,newtobs,sigma,d,g$muhatcurve,g$Khat,g$tgrid);
#
# ## plot of the posterior mean growth velocity for the new subject:
# plot(g$tgrid,ng$muhatcurvenew,xlab="Age (years)",ylab="Growth
# velocity (cms/year)");
# ## End(Not run)
Run the code above in your browser using DataLab