Displaying 1 result from an estimated 1 matches for "auc_ground".
2012 Mar 19
2
by output into data frame
...ab.samples <- subset(sanity.check,Sample!='before bed' & Sample!='morning after')
lab.samples$Sample<-factor(lab.samples$Sample)
lab.samples.stress<-subset(lab.samples,challenge=='stress')
lab.samples.control<-subset(lab.samples,challenge=='control')
auc_ground <- function(sub_df) {
print(sub_df)
auc<-sub_df[1,]*0
timedif<-c(60,10,10,10,10,10,10)
for (i in 1:(nrow(sub_df)-1) ) {
print(c(i,i+1))
#print(c(values[i],values[i+1]))
pair_area<-(sub_df[i,]+sub_df[i+1,])*timedif[i]/2
auc<-auc+pair_area
}
auc
}
auc_stress<-by(lab.s...