[R] Uniroot error message with in intergration

jeka12386 jeka12386 at hotmail.co.uk
Sat Jun 23 12:12:59 CEST 2012


Many thanks Ellison

I have modified it as you suggested but I have this error message <<<Error
in f(lower, ...) : unused argument(s) (N = 54)
>>> I am not sure which arguments I have missed? 
*y <- function(t,n){ 
diff <- 0.5 
df1 <- 2*n-2 
ncp1 <- sqrt((diff^2*n)/2) 
p <- 1- pt(t,df=df1) 
test <- qt((1-p),df=df1,ncp=ncp1)*(1/sqrt(2)) 
return(test) 
} 

integ <- function(n){ 
1-integrate(y,lower=0,upper=2.7,n)$value -0.8
} 
  
uniroot(integ,lower=0,upper=1000,N=n) 

traceback()*

--
View this message in context: http://r.789695.n4.nabble.com/Uniroot-error-message-with-in-intergration-tp4634247p4634278.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list