[R] mean and kurtosis

2012-11-09 Thread Adel Powell
Need help! I know how to get the mean and kurtosis for a single variable but I am reading in an excel file that has several columns representing variables. I need a way to find descriptive statistics across ALL the variables? [[alternative HTML version deleted]] __

[R] Problems getting slope and intercept to change when do multiple reps.

2012-10-26 Thread Adel Powell
library(ROCR) n <- 1000 fitglm <- function(iteration,intercept,sigma,tau,beta){ x <- rnorm(n,0,sigma) ystar <- intercept+beta*x z <- rbinom(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] # when a

Re: [R] How to extract auc, specificity and sensitivity

2012-10-25 Thread Adel Powell
hich(result==z))/length(z)* * * *> accuracy* [1] 0.8 *> rocpreds<-prediction(result,z)* * * *> rocpreds* *> auc<-performance(rocpreds,"auc")@y.values* * * *> auc* [[1]] [1] 0.7916667 * > fp<-performance(rocpreds,"sens")* * * *> sentiv<

Re: [R] How to extract auc, specificity and sensitivity

2012-10-25 Thread Adel Powell
ntivity [1] 1 $Specificity [1] 0 > Don't get error message but wrong values On Thu, Oct 25, 2012 at 4:05 PM, Berend Hasselman wrote: > > > Your code is still not runnable. > It gives the error message > > Error in fitglm(0.05, 1) : could not find function "pre

[R] How to extract auc, specificity and sensitivity

2012-10-25 Thread Adel Powell
I am running my code in a loop and it does not work but when I run it outside the loop I get the values I want. n <- 1000; # Sample size fitglm <- function(sigma,tau){ x <- rnorm(n,0,sigma) intercept <- 0 beta <- 0 ystar <- intercept+beta*x z <- rbinom(n,1,plogis(ystar)) x

[R] Logistic regression/Cut point? predict ??

2012-10-20 Thread Adel Powell
I am new to R and I am trying to do a monte carlo simulation where I generate data and interject error then test various cut points; however, my output was garbage (at x equal zero, I did not get .50) I am basically testing the performance of classifiers. Here is the code: n <- 1000; # Sample size