[R] How to double integrate a function in R

2013-07-29 Thread Tiago V. Pereira
. Any ideas? Tiago -- Tiago V. Pereira, MSc, PhD Center for Studies of the Human Genome Department of Genetics and Evolutionary Biology University of São Paulo Rua do Matão, 277 CEP 05508-900 São Paulo - SP, Brazil __ R-help@r-project.org mailing

[R] How to double integrate a function in R

2013-07-26 Thread Tiago V. Pereira
Hello, R users! I am trying to double integrate the following expression: # expression (1/(2*pi))*exp(-y2/2)*sqrt((y1/(y2-y1))) for y2y10. I am trying the following approach # first attempt library(cubature) fun - function(x) { (1/(2*pi))*exp(-x[2]/2)*sqrt((x[1]/(x[2]-x[1])))}

[R] How to compute a P-value for a complex mixture of chi-squared distributions in R

2013-06-01 Thread Tiago V. Pereira
Hello, R users! I am struggling with the following problem: I need to compute a P-value for a mixture of two chi-squared distributions. My P-value is given by: P = 0.5*prob(sqrt(chi2(1)) = x) + 0.5*prob(sqrt(chi2(2)) = x) In words, I need to compute the p-value for 50–50 mixture of the square

[R] How to compute a P-value for a complex mixture of chi-squared distributions in R

2013-06-01 Thread Tiago V. Pereira
Hello, R users! I am struggling with the following problem: I need to compute a P-value for a mixture of two chi-squared distributions. My P-value is given by: P = 0.5*prob(sqrt(chi2(1)) = x) + 0.5*prob(sqrt(chi2(2)) = x) In words, I need to compute the p-value for 50–50 mixture of the square

Re: [R] How to compute a P-value for a complex mixture of chi-squared distributions in R

2013-06-01 Thread Tiago V. Pereira
escreveu: On Jun 1, 2013, at 06:32 , Tiago V. Pereira wrote: Hello, R users! I am struggling with the following problem: I need to compute a P-value for a mixture of two chi-squared distributions. My P-value is given by: P = 0.5*prob(sqrt(chi2(1)) = x) + 0.5*prob(sqrt(chi2(2)) = x

[R] How to create a correct matrix in R

2013-05-22 Thread Tiago V. Pereira
Hello Rlisters! In my codes, I need to import a matrix: v - read.table(/home/tiago/matrix.txt, header=FALSE) v-as.matrix(v) v V1 V2 V3 V4 V5 V6 [1,] 1. -0.89847480 -0.73929292 -0.99055335 -0.04514469 0.04056137 [2,]

[R] How can I access information stored after I run a command in R?

2012-01-23 Thread Tiago V. Pereira
Dear all, Supposed I run the following command: ### #install.packages(Rassoc, dependencies=TRUE) library(Rassoc) ca=c(139,249,112) co=c(136,244,120) a=rbind(ca,co) MAX3(a,asy,1) ## I get: The MAX3 test using the asy method

Re: [R] How can I access information stored after I run a command in R?

2012-01-23 Thread Tiago V. Pereira
I would like to thank Justin and Matthias for their very helpful on my query (see it below). All the best, Tiago Dear all, Supposed I run the following command: ### #install.packages(Rassoc, dependencies=TRUE) library(Rassoc) ca=c(139,249,112) co=c(136,244,120)