search for: relrisk

Displaying 1 result from an estimated 1 matches for "relrisk".

Did you mean: redisk
2005 Dec 13
3
help with writing function
...e procedure for each of the j's i.e j=2 to n. The results should all be stored together. Below is what I've tried so far but it seems to work only for j=1 . Your help will be highly appreciated. IED<-function(risk){ n<-length(risk) i<-c(1:n) Diff<-numeric() for(j in 1:n){ relrisk<-risk relrisk[i]<-relrisk[j] Difference<-abs(risk-relrisk) Difference<-Difference[-c(1:j)] Difference<-append(Diff,Difference) return(Difference) } } Oarabile