search for: rocpreds

Displaying 3 results from an estimated 3 matches for "rocpreds".

2012 Oct 25
2
How to extract auc, specificity and sensitivity
...(n,1,plogis(ystar)) xerr <- x + rnorm(n,0,tau) model<-glm(z ~ xerr, family=binomial(logit)) int<-coef(model)[1] slope<-coef(model)[2] pred<-predict(model) result<-ifelse(pred>.5,1,0) accuracy<-length(which(result==z))/length(z) accuracy rocpreds<-prediction(result,z) auc<-performance(rocpreds,"auc")@y.values sentiv<-performance(rocpreds,"sens")@y.values sentiv<-slot(fp,"y.values")[[1]] sentiv<-sentiv[2] sentiv specs<-performance(rocpreds,"spec")@y.values...
2012 Oct 20
1
Logistic regression/Cut point? predict ??
...is the proportion of 0s to 1. pi0hat<-length(z[which(z==0)]/length(z)) cutmid <- log(pi0hat/pi1hat) pred<-ifelse(pred>cutmid,1,0) * I am not sure if I need to compare these two. I think this is an error. * accuracy<-length(which(pred==z))/length(z) accuracy rocpreds<-prediction(pred,z) auc<-performance(rocpreds,"auc")@y.values output<-c(int,slope,cutmid,accuracy,auc) names(output)<-c("Intercept","Slope","CutPoint","Accuracy","AUC") return(output) } y<-fitglm(.05,1) y...
2012 Oct 26
0
Problems getting slope and intercept to change when do multiple reps.
...slope*<-coef(model)[2] # when add error you are suppose to get slightly bias slope. However when I change the beta in the original X, I am not getting the save average slope as output? strange? pred<-predict(model,type="response") cutp<-.5 result<-ifelse(pred>cutp,1,0) rocpreds<-prediction(result,z) auc<-performance(rocpreds,"auc")@y.values accuracy<-length(which(result==z))/length(z) tn<- sum(z==0 & result==0) # True Negative fp<- sum(z==0 & result==1) # False Positive tp<- sum(z==1 & result==1) # True Positive fn<- s...