[R] Assistance would be appreciated
MyCalendar
rentar18 at gmail.com
Mon Mar 27 01:13:00 CEST 2017
Hi R'ers:
Newbie to R, but I guarantee that I don't ask for help until, in this case, I spent
Over ten hours today ( Sunday, wife loves it!! )
I can't find the bug, trying to remove column cum_wt.
Assistance would be appreciated.
Bruce
--- Code ---
yhat <- seq(1, 0.05, length.out = 20)
Response <-c(1,0,1,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,1,0)
cum_R <- cumsum(Response)
sam_size <- length(Response)
cum_wt <- seq(1:1,length=20)
wt <- seq(1:1,by=0, length=20)
dec <- (cum_wt/sam_size)
decc <- floor((cum_wt*10)/(sam_size+1))
dec_mean <- aggregate(Response, by=list(decc), mean)
d <- data.frame(yhat, Response, cum_R, sam_size, cum_wt,wt, decc, dec_mean)
d
#decc=0
decc_0 <- subset(d, decc ==0)
mean_decc_0 <- colMeans(decc_0, 2)
mean_decc_0[1,5] <- NULL
mean_decc_0
______________
-------
[[alternative HTML version deleted]]
More information about the R-help
mailing list