Random Relabelling

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Random Relabelling

kmatthews
I have 4000 observations that I need to randomly relabel 1000 times and then calculate the mean of the 1000 values at each of the 4000 points.  Any ideas for where to begin?

Thanks
Kevin
Reply | Threaded
Open this post in threaded view
|

Re: Random Relabelling

John Kane-2
Can you explain this a bit more. At the moment I don't see what you are trying to achieve.   "calculate the mean of the 1000 values at each of the 4000 points" does not seem to make sense.

--- On Wed, 4/20/11, kmatthews <[hidden email]> wrote:

> From: kmatthews <[hidden email]>
> Subject: [R] Random Relabelling
> To: [hidden email]
> Received: Wednesday, April 20, 2011, 10:04 AM
> I have 4000 observations that I need
> to randomly relabel 1000 times and then
> calculate the mean of the 1000 values at each of the 4000
> points.  Any ideas
> for where to begin?
>
> Thanks
> Kevin
>


______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Random Relabelling

kmatthews
I have a map of Iowa of with 4000 locations.  At each location, I have a
cancer mortality rate.  I need to test my null hypothesis; that the spatial
distribution of the mortality rates is  random.  For this test, I need to
establish a spatial reference distribution.

My reference distribution will be created by some random relabelling
algorithm.  The 4000 locations would remain fixed, but the observed
mortality rates would be randomly redistributed.  Then, I want 1000
permutations of the same algorithm.  For each of those 1000 times, I would
record the redistributed mortality rate at each location.  Then,  I would
calculate the mean of the 1000 points.  The result would be a spatial
reference distribution with a mean value of the random permutations at each
of the 4000 locations.

Thanks for the response,
Kevin

On Wed, Apr 20, 2011 at 11:08 AM, John Kane <[hidden email]> wrote:

> Can you explain this a bit more. At the moment I don't see what you are
> trying to achieve.   "calculate the mean of the 1000 values at each of the
> 4000 points" does not seem to make sense.
>
> --- On Wed, 4/20/11, kmatthews <[hidden email]> wrote:
>
> > From: kmatthews <[hidden email]>
> > Subject: [R] Random Relabelling
> > To: [hidden email]
> > Received: Wednesday, April 20, 2011, 10:04 AM
> > I have 4000 observations that I need
> > to randomly relabel 1000 times and then
> > calculate the mean of the 1000 values at each of the 4000
> > points.  Any ideas
> > for where to begin?
> >
> > Thanks
> > Kevin
> >
>
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Random Relabelling

John Kane-2
There is probably a better way to do this but a for loop like this should work. You would just need to change the numbers to yours and then add on the locations
=========================================================

scores  <- 1:5
mydata <- matrix(data=NA, nrow=5, ncol=10)

for(i in 1:10) {
mydata[,i] <- sample(scores, 5, replace=FALSE)
}

=========================================================
--- On Wed, 4/20/11, Kevin Matthews <[hidden email]> wrote:

From: Kevin Matthews <[hidden email]>
Subject: Re: [R] Random Relabelling
To: "John Kane" <[hidden email]>
Cc: [hidden email]
Received: Wednesday, April 20, 2011, 1:22 PM

I have a map of Iowa of with 4000 locations.  At each location, I have a cancer mortality rate.  I need to test my null hypothesis; that the spatial distribution of the mortality rates is  random.  For this test, I need to establish a spatial reference distribution.  


My reference distribution will be created by some random relabelling algorithm.  The 4000 locations would remain fixed, but the observed mortality rates would be randomly redistributed.  Then, I want 1000 permutations of the same algorithm.  For each of those 1000 times, I would record the redistributed mortality rate at each location.  Then,  I would calculate the mean of the 1000 points.  The result would be a spatial reference distribution with a mean value of the random permutations at each of the 4000 locations.  



Thanks for the response,Kevin

On Wed, Apr 20, 2011 at 11:08 AM, John Kane <[hidden email]> wrote:


Can you explain this a bit more. At the moment I don't see what you are trying to achieve.   "calculate the mean of the 1000 values at each of the 4000 points" does not seem to make sense.





--- On Wed, 4/20/11, kmatthews <[hidden email]> wrote:



> From: kmatthews <[hidden email]>

> Subject: [R] Random Relabelling

> To: [hidden email]

> Received: Wednesday, April 20, 2011, 10:04 AM

> I have 4000 observations that I need

> to randomly relabel 1000 times and then

> calculate the mean of the 1000 values at each of the 4000

> points.  Any ideas

> for where to begin?

>

> Thanks

> Kevin

>






        [[alternative HTML version deleted]]


______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Random Relabelling

jthetzel
Kevin,

The following follows John's suggestion, but without the loop.  It's quick
for me.

Jeremy


Jeremy T. Hetzel
Boston University



## Generate sample data
n <- 4000
rep <- 1000
rate <- rnorm(n, mean = 15, sd = 2) / 100000 # Mortality rates around
15/100k

## Create an empty matrix with appropriate dimensions
permutations <- matrix(ncol = n, nrow = rep)

## Use apply() to resample
permutations <- apply(permutations, 1, function(x)
{
sample(rate, size = n, replace = F)
})

## Look at the matrix
dim(permutations)
head(permutations)

## Find the column means
means <- apply(permutations, 1, mean)
means





On Wednesday, April 20, 2011 1:56:35 PM UTC-4, John Kane wrote:

>
> There is probably a better way to do this but a for loop like this should
> work. You would just need to change the numbers to yours and then add on the
> locations
> =========================================================
>
> scores  <- 1:5
> mydata <- matrix(data=NA, nrow=5, ncol=10)
>
> for(i in 1:10) {
> mydata[,i] <- sample(scores, 5, replace=FALSE)
> }
>
> =========================================================
> --- On Wed, 4/20/11, Kevin Matthews <[hidden email]> wrote:
>
> From: Kevin Matthews <[hidden email]>
> Subject: Re: [R] Random Relabelling
> To: "John Kane" <[hidden email]>
> Cc: [hidden email]
> Received: Wednesday, April 20, 2011, 1:22 PM
>
> I have a map of Iowa of with 4000 locations.  At each location, I have a
> cancer mortality rate.  I need to test my null hypothesis; that the spatial
> distribution of the mortality rates is  random.  For this test, I need to
> establish a spatial reference distribution.  
>
>
> My reference distribution will be created by some random relabelling
> algorithm.  The 4000 locations would remain fixed, but the observed
> mortality rates would be randomly redistributed.  Then, I want 1000
> permutations of the same algorithm.  For each of those 1000 times, I would
> record the redistributed mortality rate at each location.  Then,  I would
> calculate the mean of the 1000 points.  The result would be a spatial
> reference distribution with a mean value of the random permutations at each
> of the 4000 locations.  
>
> Thanks for the response,Kevin
>
> On Wed, Apr 20, 2011 at 11:08 AM, John Kane <[hidden email]> wrote:
>
>
> Can you explain this a bit more. At the moment I don't see what you are
> trying to achieve.   "calculate the mean of the 1000 values at each of the
> 4000 points" does not seem to make sense.
>
> --- On Wed, 4/20/11, kmatthews <[hidden email]> wrote:
>
> > From: kmatthews <[hidden email]>
>
> > Subject: [R] Random Relabelling
>
> > To: [hidden email]
>
> > Received: Wednesday, April 20, 2011, 10:04 AM
>
> > I have 4000 observations that I need
>
> > to randomly relabel 1000 times and then
>
> > calculate the mean of the 1000 values at each of the 4000
>
> > points.  Any ideas
>
> > for where to begin?
>
> >
>
> > Thanks
>
> > Kevin
>
> >
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] 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.
>
>
______________________________________________
[hidden email] 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.
Jeremy T. Hetzel
Boston University
Reply | Threaded
Open this post in threaded view
|

Re: Random Relabelling

djmuseR
In reply to this post by kmatthews
Hi:

How about

y <- rnorm(4000)
ymat <- rowMeans(replicate(1000, y[sample(4000)]))
hist(ymeans)

system.time({y <- rnorm(4000); yy <- rowMeans(replicate(1000,
y[sample(4000)]))})
   user  system elapsed
   0.19    0.03    0.22

HTH,
Dennis

On Wed, Apr 20, 2011 at 7:04 AM, kmatthews <[hidden email]> wrote:

> I have 4000 observations that I need to randomly relabel 1000 times and then
> calculate the mean of the 1000 values at each of the 4000 points.  Any ideas
> for where to begin?
>
> Thanks
> Kevin
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Random-Relabelling-tp3463100p3463100.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> [hidden email] 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.
>

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Random Relabelling

John Kane-2
In reply to this post by jthetzel
I KNEW there was a better way!

--- On Wed, 4/20/11, Jeremy Hetzel <[hidden email]> wrote:

> From: Jeremy Hetzel <[hidden email]>
> Subject: Re: [R] Random Relabelling
> To: [hidden email]
> Cc: [hidden email], "Kevin Matthews" <[hidden email]>
> Received: Wednesday, April 20, 2011, 2:25 PM
> Kevin,
>
> The following follows John's suggestion, but without the
> loop.  It's quick
> for me.
>
> Jeremy
>
>
> Jeremy T. Hetzel
> Boston University
>
>
>
> ## Generate sample data
> n <- 4000
> rep <- 1000
> rate <- rnorm(n, mean = 15, sd = 2) / 100000 # Mortality
> rates around
> 15/100k
>
> ## Create an empty matrix with appropriate dimensions
> permutations <- matrix(ncol = n, nrow = rep)
>
> ## Use apply() to resample
> permutations <- apply(permutations, 1, function(x)
> {
> sample(rate, size = n, replace = F)
> })
>
> ## Look at the matrix
> dim(permutations)
> head(permutations)
>
> ## Find the column means
> means <- apply(permutations, 1, mean)
> means
>
>
>
>
>
> On Wednesday, April 20, 2011 1:56:35 PM UTC-4, John Kane
> wrote:
> >
> > There is probably a better way to do this but a for
> loop like this should
> > work. You would just need to change the numbers to
> yours and then add on the
> > locations
> >
> =========================================================
> >
> > scores  <- 1:5
> > mydata <- matrix(data=NA, nrow=5, ncol=10)
> >
> > for(i in 1:10) {
> > mydata[,i] <- sample(scores, 5, replace=FALSE)
> > }
> >
> >
> =========================================================
> > --- On Wed, 4/20/11, Kevin Matthews <[hidden email]>
> wrote:
> >
> > From: Kevin Matthews <[hidden email]>
> > Subject: Re: [R] Random Relabelling
> > To: "John Kane" <[hidden email]>
> > Cc: [hidden email]
> > Received: Wednesday, April 20, 2011, 1:22 PM
> >
> > I have a map of Iowa of with 4000 locations.  At
> each location, I have a
> > cancer mortality rate.  I need to test my null
> hypothesis; that the spatial
> > distribution of the mortality rates is 
> random.  For this test, I need to
> > establish a spatial reference distribution. 
> >
> >
> > My reference distribution will be created by some
> random relabelling
> > algorithm.  The 4000 locations would remain
> fixed, but the observed
> > mortality rates would be randomly redistributed. 
> Then, I want 1000
> > permutations of the same algorithm.  For each of
> those 1000 times, I would
> > record the redistributed mortality rate at each
> location.  Then,  I would
> > calculate the mean of the 1000 points.  The
> result would be a spatial
> > reference distribution with a mean value of the random
> permutations at each
> > of the 4000 locations. 
> >
> > Thanks for the response,Kevin
> >
> > On Wed, Apr 20, 2011 at 11:08 AM, John Kane <[hidden email]>
> wrote:
> >
> >
> > Can you explain this a bit more. At the moment I don't
> see what you are
> > trying to achieve.   "calculate the
> mean of the 1000 values at each of the
> > 4000 points" does not seem to make sense.
> >
> > --- On Wed, 4/20/11, kmatthews <[hidden email]>
> wrote:
> >
> > > From: kmatthews <[hidden email]>
> >
> > > Subject: [R] Random Relabelling
> >
> > > To: [hidden email]
> >
> > > Received: Wednesday, April 20, 2011, 10:04 AM
> >
> > > I have 4000 observations that I need
> >
> > > to randomly relabel 1000 times and then
> >
> > > calculate the mean of the 1000 values at each of
> the 4000
> >
> > > points.  Any ideas
> >
> > > for where to begin?
> >
> > >
> >
> > > Thanks
> >
> > > Kevin
> >
> > >
> >
> >
> > [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > [hidden email]
> 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.
> >
> >
> -----Inline Attachment Follows-----
>
> ______________________________________________
> [hidden email]
> 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.
>

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Random Relabelling

Peter Ehlers
On 2011-04-23 03:42, John Kane wrote:

> I KNEW there was a better way!
>
> --- On Wed, 4/20/11, Jeremy Hetzel<[hidden email]>  wrote:
>
>> From: Jeremy Hetzel<[hidden email]>
>> Subject: Re: [R] Random Relabelling
>> To: [hidden email]
>> Cc: [hidden email], "Kevin Matthews"<[hidden email]>
>> Received: Wednesday, April 20, 2011, 2:25 PM
>> Kevin,
>>
>> The following follows John's suggestion, but without the
>> loop.  It's quick
>> for me.
>>
>> Jeremy
>>
>>
>> Jeremy T. Hetzel
>> Boston University
>>
>>
>>
>> ## Generate sample data
>> n<- 4000
>> rep<- 1000
>> rate<- rnorm(n, mean = 15, sd = 2) / 100000 # Mortality
>> rates around
>> 15/100k
>>
>> ## Create an empty matrix with appropriate dimensions
>> permutations<- matrix(ncol = n, nrow = rep)
>>
>> ## Use apply() to resample
>> permutations<- apply(permutations, 1, function(x)
>> {
>> sample(rate, size = n, replace = F)
>> })
>>
>> ## Look at the matrix
>> dim(permutations)
>> head(permutations)
>>
>> ## Find the column means
>> means<- apply(permutations, 1, mean)
>> means
>>

And you might note that

  means <- rowMeansy(permutations)

is about 10-15 times faster (if speed matters).

Peter Ehlers

[...snipped...]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Random Relabelling

kmatthews
In reply to this post by jthetzel
Thanks to everyone... this helps a lot.  Just a quick question about etiquette in this forum (as it my first time questioning)... are notes of gratitude usually given in these forums?  

On Wed, Apr 20, 2011 at 1:26 PM, jthetzel [via R] <[hidden email]> wrote:
Kevin,

The following follows John's suggestion, but without the loop.  It's quick
for me.

Jeremy


Jeremy T. Hetzel
Boston University



## Generate sample data
n <- 4000
rep <- 1000
rate <- rnorm(n, mean = 15, sd = 2) / 100000 # Mortality rates around
15/100k

## Create an empty matrix with appropriate dimensions
permutations <- matrix(ncol = n, nrow = rep)

## Use apply() to resample
permutations <- apply(permutations, 1, function(x)
{
sample(rate, size = n, replace = F)
})

## Look at the matrix
dim(permutations)
head(permutations)

## Find the column means
means <- apply(permutations, 1, mean)
means





On Wednesday, April 20, 2011 1:56:35 PM UTC-4, John Kane wrote:

>
> There is probably a better way to do this but a for loop like this should
> work. You would just need to change the numbers to yours and then add on the
> locations
> =========================================================
>
> scores  <- 1:5
> mydata <- matrix(data=NA, nrow=5, ncol=10)
>
> for(i in 1:10) {
> mydata[,i] <- sample(scores, 5, replace=FALSE)
> }
>
> =========================================================
> --- On Wed, 4/20/11, Kevin Matthews <[hidden email]> wrote:
>
> From: Kevin Matthews <[hidden email]>
> Subject: Re: [R] Random Relabelling
> To: "John Kane" <[hidden email]>
> Cc: [hidden email]
> Received: Wednesday, April 20, 2011, 1:22 PM

>
> I have a map of Iowa of with 4000 locations.  At each location, I have a
> cancer mortality rate.  I need to test my null hypothesis; that the spatial
> distribution of the mortality rates is  random.  For this test, I need to
> establish a spatial reference distribution.  
>
>
> My reference distribution will be created by some random relabelling
> algorithm.  The 4000 locations would remain fixed, but the observed
> mortality rates would be randomly redistributed.  Then, I want 1000
> permutations of the same algorithm.  For each of those 1000 times, I would
> record the redistributed mortality rate at each location.  Then,  I would
> calculate the mean of the 1000 points.  The result would be a spatial
> reference distribution with a mean value of the random permutations at each
> of the 4000 locations.  
>
> Thanks for the response,Kevin
>
> On Wed, Apr 20, 2011 at 11:08 AM, John Kane <[hidden email]> wrote:
>
>
> Can you explain this a bit more. At the moment I don't see what you are
> trying to achieve.   "calculate the mean of the 1000 values at each of the
> 4000 points" does not seem to make sense.
>
> --- On Wed, 4/20/11, kmatthews <[hidden email]> wrote:
>
> > From: kmatthews <[hidden email]>
>
> > Subject: [R] Random Relabelling
>
> > To: [hidden email]
>

> > Received: Wednesday, April 20, 2011, 10:04 AM
>
> > I have 4000 observations that I need
>
> > to randomly relabel 1000 times and then
>
> > calculate the mean of the 1000 values at each of the 4000
>
> > points.  Any ideas
>
> > for where to begin?
>
> >
>
> > Thanks
>
> > Kevin
>
> >
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] 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.
>
>
______________________________________________
[hidden email] 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.
Jeremy T. Hetzel
Boston University



If you reply to this email, your message will be added to the discussion below:
http://r.789695.n4.nabble.com/Random-Relabelling-tp3463100p3463799.html
To unsubscribe from Random Relabelling, click here.

Reply | Threaded
Open this post in threaded view
|

Re: Random Relabelling

David Winsemius

On Apr 25, 2011, at 10:53 AM, kmatthews wrote:

> Thanks to everyone... this helps a lot.  Just a quick question about
> etiquette in this forum (as it my first time questioning)... are  
> notes of
> gratitude usually given in these forums?

The practice varies, some people do appreciate it. Doing so when one  
is not subscribed, however, adds many additional mouse-maneuvers to  
the moderator workload, ...  wasted time in my opinion. I would  
suggest a private thank you message in that instance (or even more to  
be preferred ... subscribing.)

--
David.

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Random Relabelling

John Kane-2
In reply to this post by kmatthews


--- On Mon, 4/25/11, kmatthews <[hidden email]> wrote:

> From: kmatthews <[hidden email]>
> Subject: Re: [R] Random Relabelling
> To: [hidden email]
> Received: Monday, April 25, 2011, 10:53 AM
> Thanks to everyone... this helps a
> lot.  Just a quick question about
> etiquette in this forum (as it my first time
> questioning)... are notes of
> gratitude usually given in these forums?

Certainly and thanks

>
> On Wed, Apr 20, 2011 at 1:26 PM, jthetzel [via R] <
> [hidden email]>
> wrote:
>
> > Kevin,
> >
> > The following follows John's suggestion, but without
> the loop.  It's quick
> > for me.
> >
> > Jeremy
> >
> >
> > Jeremy T. Hetzel
> > Boston University
> >
> >
> >
> > ## Generate sample data
> > n <- 4000
> > rep <- 1000
> > rate <- rnorm(n, mean = 15, sd = 2) / 100000 #
> Mortality rates around
> > 15/100k
> >
> > ## Create an empty matrix with appropriate dimensions
> > permutations <- matrix(ncol = n, nrow = rep)
> >
> > ## Use apply() to resample
> > permutations <- apply(permutations, 1, function(x)
> > {
> > sample(rate, size = n, replace = F)
> > })
> >
> > ## Look at the matrix
> > dim(permutations)
> > head(permutations)
> >
> > ## Find the column means
> > means <- apply(permutations, 1, mean)
> > means
> >
> >
> >
> >
> >
> > On Wednesday, April 20, 2011 1:56:35 PM UTC-4, John
> Kane wrote:
> >
> > >
> > > There is probably a better way to do this but a
> for loop like this should
> >
> > > work. You would just need to change the numbers
> to yours and then add on
> > the
> > > locations
> > >
> =========================================================
> > >
> > > scores  <- 1:5
> > > mydata <- matrix(data=NA, nrow=5, ncol=10)
> > >
> > > for(i in 1:10) {
> > > mydata[,i] <- sample(scores, 5,
> replace=FALSE)
> > > }
> > >
> > >
> =========================================================
> > > --- On Wed, 4/20/11, Kevin Matthews <[hidden
> email]<http://user/SendEmail.jtp?type=node&node=3463799&i=0&by-user=t>>
> > wrote:
> > >
> > > From: Kevin Matthews <[hidden email]<http://user/SendEmail.jtp?type=node&node=3463799&i=1&by-user=t>>
> >
> > > Subject: Re: [R] Random Relabelling
> > > To: "John Kane" <[hidden email]<http://user/SendEmail.jtp?type=node&node=3463799&i=2&by-user=t>>
> >
> > > Cc: [hidden email]<http://user/SendEmail.jtp?type=node&node=3463799&i=3&by-user=t>
> > > Received: Wednesday, April 20, 2011, 1:22 PM
> > >
> > > I have a map of Iowa of with 4000
> locations.  At each location, I have a
> > > cancer mortality rate.  I need to test my
> null hypothesis; that the
> > spatial
> > > distribution of the mortality rates is 
> random.  For this test, I need to
> >
> > > establish a spatial reference distribution.
> > >
> > >
> > > My reference distribution will be created by some
> random relabelling
> > > algorithm.  The 4000 locations would remain
> fixed, but the observed
> > > mortality rates would be randomly
> redistributed.  Then, I want 1000
> > > permutations of the same algorithm.  For
> each of those 1000 times, I
> > would
> > > record the redistributed mortality rate at each
> location.  Then,  I would
> >
> > > calculate the mean of the 1000 points.  The
> result would be a spatial
> > > reference distribution with a mean value of the
> random permutations at
> > each
> > > of the 4000 locations.
> > >
> > > Thanks for the response,Kevin
> > >
> > > On Wed, Apr 20, 2011 at 11:08 AM, John Kane
> <[hidden email]<http://user/SendEmail.jtp?type=node&node=3463799&i=4&by-user=t>>
> > wrote:
> > >
> > >
> > > Can you explain this a bit more. At the moment I
> don't see what you are
> > > trying to achieve.   "calculate
> the mean of the 1000 values at each of
> > the
> > > 4000 points" does not seem to make sense.
> > >
> > > --- On Wed, 4/20/11, kmatthews <[hidden
> email]<http://user/SendEmail.jtp?type=node&node=3463799&i=5&by-user=t>>
> > wrote:
> > >
> > > > From: kmatthews <[hidden email]<http://user/SendEmail.jtp?type=node&node=3463799&i=6&by-user=t>>
> >
> > >
> > > > Subject: [R] Random Relabelling
> > >
> > > > To: [hidden email]<http://user/SendEmail.jtp?type=node&node=3463799&i=7&by-user=t>
> > >
> > > > Received: Wednesday, April 20, 2011, 10:04
> AM
> > >
> > > > I have 4000 observations that I need
> > >
> > > > to randomly relabel 1000 times and then
> > >
> > > > calculate the mean of the 1000 values at
> each of the 4000
> > >
> > > > points.  Any ideas
> > >
> > > > for where to begin?
> > >
> > > >
> > >
> > > > Thanks
> > >
> > > > Kevin
> > >
> > > >
> > >
> > >
> > > [[alternative HTML version deleted]]
> > >
> > > ______________________________________________
> > > [hidden email]<http://user/SendEmail.jtp?type=node&node=3463799&i=8&by-user=t>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.
> > >
> > >
> > ______________________________________________
> > [hidden email]<http://user/SendEmail.jtp?type=node&node=3463799&i=9&by-user=t>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.
> > Jeremy T. Hetzel
> > Boston University
> >
> >
> > ------------------------------
> >  If you reply to this email, your message will be
> added to the discussion
> > below:
> > http://r.789695.n4.nabble.com/Random-Relabelling-tp3463100p3463799.html
> >  To unsubscribe from Random Relabelling, click
> here<
> >
> >
>
>
> --
> View this message in context:
http://r.789695.n4.nabble.com/Random-Relabelling-tp3463100p3473298.html
> Sent from the R help mailing list archive at Nabble.com.
>     [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email]
> 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.
>

______________________________________________
[hidden email] 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.