Re: [R-sig-eco] Question about GEE and interaction plot

2014-10-17 Thread ONKELINX, Thierry
Dear Luis,

1) Have a look at the multcomp package for the multiple comparisons. You will 
have to define the relevant contrasts manually.
2) reorder() will help you.  reorder(C$Comportamiento, C$Conteo, FUN = mean)

Best regards,

ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and 
Forest
team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium
+ 32 2 525 02 51
+ 32 54 43 61 85
thierry.onkel...@inbo.be
www.inbo.be

To call in the statistician after the experiment is done may be no more than 
asking him to perform a post-mortem examination: he may be able to say what the 
experiment died of.
~ Sir Ronald Aylmer Fisher

The plural of anecdote is not data.
~ Roger Brinner

The combination of some data and an aching desire for an answer does not ensure 
that a reasonable answer can be extracted from a given body of data.
~ John Tukey


-Oorspronkelijk bericht-
Van: r-sig-ecology-boun...@r-project.org 
[mailto:r-sig-ecology-boun...@r-project.org] Namens Luis Fernando García
Verzonden: vrijdag 17 oktober 2014 15:17
Aan: r-sig-ecology@r-project.org
Onderwerp: [R-sig-eco] Question about GEE and interaction plot

Hello all!

I am trying to analyze a dataset using the GEE.

This is what I have so far

C=read.table("Cnarinofinal4.txt",header=T)
attach(C)
names(C)
library(geepack)
Form <-
formula(Conteo~Grupo+Tiempo+Comportamiento+Comportamiento*Grupo+Comportamiento*Hora)
M4 <- geeglm(Form,family = poisson, id =Individuo, corstr = "exchangeable")
anova(M4)

1) I want to know if someboy knows how to perform post hoc comparisons for 
significant terms, in this case I have a significance result for the 
interaction Comportamiento*Hora and the factor Comportamiento.

2) I want to perform and interaction plot, I tried with the following code:
 interaction.plot(C$Comportamiento,C$Tiempo,C$Conteo)

Nevertheless, I would like to plot the graph in a decreasing order by the mean 
and also add the error bars. For the first approach I do not have available 
info, and for the second one I found that data must be sorted before using the 
function summarySE from the ggplot2 library, nevertheless it does not seem to 
work anymore.

Any help you can provide will be welcome!
* * * * * * * * * * * * * D I S C L A I M E R * * * * * * * * * * * * *
Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer en 
binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is 
door een geldig ondertekend document.
The views expressed in this message and any annex are purely those of the 
writer and may not be regarded as stating an official position of INBO, as long 
as the message is not confirmed by a duly signed document.
___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] Question about GEE and interaction plot

2014-10-17 Thread Luis Fernando García
Hello all!

I am trying to analyze a dataset using the GEE.

This is what I have so far

C=read.table("Cnarinofinal4.txt",header=T)
attach(C)
names(C)
library(geepack)
Form <-
formula(Conteo~Grupo+Tiempo+Comportamiento+Comportamiento*Grupo+Comportamiento*Hora)
M4 <- geeglm(Form,family = poisson, id =Individuo, corstr = "exchangeable")
anova(M4)

1) I want to know if someboy knows how to perform post hoc comparisons for
significant terms, in this case I have a significance result for the
interaction Comportamiento*Hora and the factor Comportamiento.

2) I want to perform and interaction plot, I tried with the following code:
 interaction.plot(C$Comportamiento,C$Tiempo,C$Conteo)

Nevertheless, I would like to plot the graph in a decreasing order by the
mean and also add the error bars. For the first approach I do not have
available info, and for the second one I found that data must be sorted
before using the function summarySE from the ggplot2 library, nevertheless
it does not seem to work anymore.

Any help you can provide will be welcome!
HoraIndividuo   Comportamiento  Tiempo  Grupo   Conteo
0   1   Exploración NOCHE   MACHO   1
0   1   interacciones   NOCHE   MACHO   0
0   1   Mantenimiento   NOCHE   MACHO   0
0   1   AlimentaciónNOCHE   MACHO   5
0   1   ReproducciónNOCHE   MACHO   0
0   1   Reposo  NOCHE   MACHO   2
0   1   Exacavación NOCHE   MACHO   0
0   2   Exploración NOCHE   MACHO   0
0   2   interacciones   NOCHE   MACHO   0
0   2   Mantenimiento   NOCHE   MACHO   0
0   2   AlimentaciónNOCHE   MACHO   0
0   2   ReproducciónNOCHE   MACHO   0
0   2   Reposo  NOCHE   MACHO   7
0   2   Exacavación NOCHE   MACHO   0
0   3   Exploración NOCHE   MACHO   1
0   3   interacciones   NOCHE   MACHO   0
0   3   Mantenimiento   NOCHE   MACHO   0
0   3   AlimentaciónNOCHE   MACHO   0
0   3   ReproducciónNOCHE   MACHO   0
0   3   Reposo  NOCHE   MACHO   7
0   3   Exacavación NOCHE   MACHO   0
0   4   Exploración NOCHE   MACHO   3
0   4   interacciones   NOCHE   MACHO   0
0   4   Mantenimiento   NOCHE   MACHO   0
0   4   AlimentaciónNOCHE   MACHO   1
0   4   ReproducciónNOCHE   MACHO   0
0   4   Reposo  NOCHE   MACHO   5
0   4   Exacavación NOCHE   MACHO   0
0   5   Exploración NOCHE   MACHO   1
0   5   interacciones   NOCHE   MACHO   0
0   5   Mantenimiento   NOCHE   MACHO   0
0   5   AlimentaciónNOCHE   MACHO   1
0   5   ReproducciónNOCHE   MACHO   0
0   5   Reposo  NOCHE   MACHO   8
0   5   Exacavación NOCHE   MACHO   0
0   6   Exploración NOCHE   MACHO   3
0   6   interacciones   NOCHE   MACHO   0
0   6   Mantenimiento   NOCHE   MACHO   0
0   6   AlimentaciónNOCHE   MACHO   0
0   6   ReproducciónNOCHE   MACHO   0
0   6   Reposo  NOCHE   MACHO   2
0   6   Exacavación NOCHE   MACHO   0
0   7   Exploración NOCHE   HEMBRA  3
0   7   interacciones   NOCHE   HEMBRA  0
0   7   Mantenimiento   NOCHE   HEMBRA  0
0   7   AlimentaciónNOCHE   HEMBRA  0
0   7   ReproducciónNOCHE   HEMBRA  0
0   7   Reposo  NOCHE   HEMBRA  5
0   7   Exacavación NOCHE   HEMBRA  0
0   8   Exploración NOCHE   HEMBRA  2
0   8   interacciones   NOCHE   HEMBRA  0
0   8   Mantenimiento   NOCHE   HEMBRA  0
0   8   AlimentaciónNOCHE   HEMBRA  0
0   8   ReproducciónNOCHE   HEMBRA  0
0   8   Reposo  NOCHE   HEMBRA  2
0   8   Exacavación NOCHE   HEMBRA  0
0   9   Exploración NOCHE   HEMBRA  2
0   9   interacciones   NOCHE   HEMBRA  0
0   9   Mantenimiento   NOCHE   HEMBRA  0
0   9   AlimentaciónNOCHE   HEMBRA  0
0   9   ReproducciónNOCHE   HEMBRA  0
0   9   Reposo  NOCHE   HEMBRA  5
0   9   Exacavación NOCHE   HEMBRA  0
0   10  Exploración NOCHE   HEMBRA  6
0   10  interacciones   NOCHE   HEMBRA  0
0   10  Mantenimiento   NOCHE   HEMBRA  0
0   10  AlimentaciónNOCHE   HEMBRA  0
0   10  ReproducciónNOCHE   HEMBRA  0
0   10  Reposo  NOCHE   HEMBRA  2
0   10  Exacavación NOCHE   HEMBRA  0
0   11  Exploración NOCHE   HEMBRA  1
0   11  interacciones   NOCHE   HEMBRA  0
0   11  Mantenimiento   NOCHE   HEMBRA  0
0   11  AlimentaciónNOCHE   HEMBRA  2
0   11  ReproducciónNOCHE   HEMBRA  0
0   11  Reposo  NOCHE   HEMBRA  4
0   11  Exacavación NOCHE   HEMBRA  0
0   12  Exploración NOCHE   HEMBRA  2
0   12  interacciones   NOCHE   HEMBRA  0
0   12  Ma