[R] Please help me about Monte Carlo Permutation
Kjetil Halvorsen
kjetilbrinchmannhalvorsen at gmail.com
Thu Oct 28 16:47:31 CEST 2010
This is one way. I read your two columns of data into
two variables, x and y. Then:
test <- replicate(5000, cor(x, sample(y)))
> hist(test)
Kjetil
On Thu, Oct 28, 2010 at 9:49 AM, Chitra <cbbaniya at gmail.com> wrote:
>
>> Dear R experts,
>>I am sorry for my inability.
>>I have the following dataset:
>
> > Qtot Itot
>>1 73 684
>>2 64 451
>>3 71 378
>>4 65 284
>>5 47 179
>>6 31 117
>>7 19 69
>>
>>Now I need to perform Monte Carlo Pertutation test underlaying the
> following condition.
>>
>>
>>Condition
>>
>>In order to choose randomly (5000 times) for the Qtot in the interval 0 to
> the maximum possible value of
>>
>>Qtot for each observed value of the independent variable (Itot), Monte
> Carlo tests needed to be perform to test the null hypothesis. The
>>maximum observed value is either the calculated size of the regional pool
> (Interpolated value), or the measured size of the actual
>>
>>pool. Each time correlation coefficient (r) between independent and
> dependent variable has to be calculated in order to achieve
>>
>>the empirical distribution of r for the null hypothesis conditions.
>>
>>Now please help me how to do?
>>I have also intalled combinat library in R. But could not perform by
> myself.
>>I will be highly grateful.
>>Thanks.
>>
> -->
> Chitra Bahadur Baniya (PhD)
> Lecturer
> Central Department of Botany
> Tribhuvan University
> Kirtipur
> Kathmandu, Nepal
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Please-help-me-about-Monte-Carlo-Permutation-tp3017131p3017131.html
> Sent from the R help mailing list archive at Nabble.com.
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
More information about the R-help
mailing list