Comparing three groups, data: present, absent

Previous Topic Next Topic
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view

Comparing three groups, data: present, absent

Mächler  Marc Jaques
Dear R-Experts, Dear friends of dung.

I have a statistical Problem, to which nobody I asked could give me an answer. Maybe you can.

I was in the African-Savanna and made a Dung-Monitoring. This means I walked randomly over the field and for every Dung-Event I found I noted following parameters:

Species (Waterbuck, Giraffe, Reedbuck);
Age-Category (less than a week, more than a week & less than a month, more than a month);
Termites present (0 or 1);

Now I want to compare for every species, if the percentage of Termites attack differ between the different Age-Categories

and if the percentage of attacks of Species differ between the same  Age-Categories.

I only found a lot of very complicated models for "Presence / Absence". But I do not need to find a treshold, I just want to compare groups.

My Question now:

- What test do I have to use to compare groups.
- Do I have to transform the data (Termite.Attack which is 0 and 1)?

I really appreciate every hint.

Thanks a lot,

Dung-Master Marc-Jacques from the swiss federal institute of technology

[hidden email] mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view

Re: Comparing three groups, data: present, absent

Wu Gong
## Dung observations
## Create a sample original data
data <- data.frame(Species=sample(c("W", "G", "R"), 200, replace=TRUE),
        Age=sample(c("days", "weeks", "months"),200,replace=TRUE),

## Show what original data look like

  Species    Age Termites
1       W months        0
2       R  weeks        0
3       W  weeks        0
4       G  weeks        0
5       R months        1
6       W   days        1

## Analyze each species
## Here we just tabulate Waterbuck as an example
data.w <- data[data$Species == "W",]
table.w <- table(data.w[,2:3])

## The results table looks like
Age       0  1
  days   18  9
  months  9 11
  weeks  10 18
## Apply Chi-squared Test

## Usually use Pearson's Chi-squared Test
## If your data are not suitable for the Pearson's Chi-squared Test, it seems that R will tell you.
## H0 : All three age groups have same Termites attack percentage.
## H1 : All situations except H0.