# [R-sig-Geo] analyzing spatial segregation of sexes

Thu May 10 16:59:52 CEST 2012

```All,

Thanks for help on this. I think that I now understand the ppp object.

Marcelino, thanks for the excellent explanation of implementing the multitype K function. I think this is the approach that I should take in analyzing the data, as Mathieu suggested.

Robert, thanks for the link to the pdf. It looks like an excellent read.

-----Original Message-----
From: Marcelino de la Cruz [mailto:marcelino.delacruz at upm.es]
Sent: Thursday, May 10, 2012 4:03 AM
To: Mathieu Rajerison; Wall, Wade A ERDC-RDE-CERL-IL
Cc: r-sig-geo at r-project.org
Subject: Re: [R-sig-Geo] analyzing spatial segregation of sexes

Hi,

with respect to the implementation of the "Bivariate i.e.2-type point pattern (see package 'spatstat')" you may do something like this:

library(spatstat)

plants.ppp <- ppp( x = example\$x, y =example\$y, marks=factor(sex), window = yourwindow),

where "example" is a data.frame with your data and  "yourwindow" are the boundaries of your study area. See help (ppp) and help (owin) to see several ways of specifying the window. If you are impatient and have many points you could try this:

plants.ppp <- ppp( x = example\$x, y =example\$y, marks=factor(sex), xrange=range(example\$x), yrange = range(example\$y))

Asessing segregation in spatstat would imply computing differences of
univariata and bivariate functions;e.g., to compute the segregation
of females you should do:

Kff <- Kcross(plants.ppp, i="F", j="F")
Kfm <- Kcross(plants.ppp, i="F", j="M")

D <- eval.fv(Kff-Kfm)

Ploting this function [i.e,  plot(D)] would show you at which scales
(if any) D > 0 (segregation of female sex) or D <
0  ("overdispersion" ?of female sex).

By the way, function K1K2 in package ecespa implements test of these
functions against a null model of random labeling.

HTH,

Marcelino

At 09:27 10/05/2012, Mathieu Rajerison wrote:
>Hi!
>
>Why not use, for example, KCross spatstat function, given two point
>patterns: one for male individuals and one for female ones?
>
>
>
> > Hi all,
> >
> > I have a data set that consists of x,y coordinates for individual plants,
> > along with sex of the individual.
> >
> > Example
> >
> > Ind     sex     x       y
> > 1       F       10      5
> > 2       M       9       4
> > . . .
> > 200     M       20      4
> >
> > for 20 populations of the species. I would like to know if males and
> > females are randomly dispersed, or tend to segregate.
> >
> > I would like to use Philip Dixon's method (1994), and there is an
> > implementation in the R package "spatialsegregation" (dixon(X, prepR=0)).
> > However,
> > I am not very familiar with spatial analyses in R and am not sure how to
> > structure the input object X. The function description says "Bivariate i.e.
> > 2-type point pattern (see package 'spatstat')"
> >
> > Does anyone know how to structure the data that I have (example above) so
> > that I can use dixon()? Thanks for any help.
> >
> >
> > _______________________________________________
> > R-sig-Geo mailing list
> > R-sig-Geo at r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> >
>
>         [[alternative HTML version deleted]]
>
>_______________________________________________
>R-sig-Geo mailing list
>R-sig-Geo at r-project.org
>https://stat.ethz.ch/mailman/listinfo/r-sig-geo

```