Displaying 1 result from an estimated 1 matches for "semivario".
2010 Sep 16
4
Pesky homemade function code
Hi all-
this seems to be simple to figure out but since im new to writing functions
I dont know what is happening. Here is my code along with the error I am
receiving:
semivario=function(data,ids,times,resids){
id=unique(data$ids)
index=combinations(length(data$times[data$ids==id[1]]),2)
time=gamma=numeric(dim(index)[1])
for (j in 1:dim(index)[1]){
time[j]=abs(data$times[data$ids==id[1]][index[j,1]]-data$times[data$ids==id[1]][index[j,2]])
gamma[j]=.5*(data$resids[data$i...