Displaying 1 result from an estimated 1 matches for "devlci".
2005 Aug 26
1
Help in Compliling user -defined functions in Rpart
...;-sum(wt)-lw
lm<-lss/lw
rm<-rss/rw
lcss<-cumsum(wt[1:length(lm)]*(y[1:length(lm)]-lm)*(r[1:length(lm)]-0.5))
rcss<-sum(wt*(y-wmean)*(r-0.5))-lcss
lci<-2*lcss/lss #concentration index for left side
rci<-2*rcss/rss #concentration index for right side
devlci<-abs(lci)*(1-abs(lci)) #deviance for left side
devrci<-abs(rci)*(1-abs(rci)) #deviance for right side
goodness<-devci-(lw/sum(wt))*devlci-(rw/sum(wt))*devrci
list(goodness=goodness, direction=sign(lci))
}
else {
ux<-sort(unique(x))
wtsum<-tapply(wt,x,su...