[R] help with sitar growth model
Rayt Chiruka
rtch|ruk@ @end|ng |rom gm@||@com
Tue Mar 19 16:17:23 CET 2019
I want to obtain the individual biological parameters (ie age at takeoff,
final height velocity at takeoff) after a sitar model. (I do understand a
sitar model fits a mean curve for the population).
I have managed to obtain the parameters for one individual using the code
below,
library(sitar)
data(heights)
library(tidyverse)
m1 <- sitar(x=age, y=height, id=id, data=heights, df=5)
#velocity at takeoff for individual 1
(vel_attoff<-getPeakTrough(plot_v(m1, subset=age < 14 &id==1) ,
peak=FALSE))
What I want is to produce a dataframe with the id and the velocity at
takeoff for each individual in the dataset.
I have tried to do this
for (i in seq_along(heights[1])){
print(getPeakTrough(plot_v(m1, subset=age < 14 & id==i) ,
peak=FALSE))
}
But it prints only one x and y value
Any assistance will be greatly appreciated
--
R T CHIRUKA
University of Fort Hare
Statistics Department
Box X 1314
Alice
5700
South Africa
[[alternative HTML version deleted]]
More information about the R-help
mailing list