Displaying 1 result from an estimated 1 matches for "computedobs".
Did you mean:
computadors
2010 Sep 29
1
Trying to avoid loop structure
...(intercept and slope) to tens of thousands of observations based on a table with benchmark values.
#####Example - Value table and their corresponding coefficients (intercept and slope)
coef = data.frame(cbind(st=c(1:5),b = runif(5,0.3,5),a = seq(0.5,5,1)))print(coef)
#Example of observations to be computedobs = runif(20,1,5)print(obs)
#This should be fairly simple - but I can't get the loop structure out of my head. I don't know how to tell the software "if the observation is greater than st[i-1] but smaller than st[i], use a[i] and b[i] - otherwise go to the next line".So far, I'...