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]]
__
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
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<
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
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
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
6 matches
Mail list logo