pairwiseComparisons

22 views
Skip to first unread message

Denis Lafage

unread,
Aug 19, 2018, 2:45:00 PM8/19/18
to tRophicPosition
Hi,

I would like to compare posterior trophic positions of a fish species between different location. The issue is that stable isotope values were obtained from muscles, whole body or fine clip, depending on the individuals' size.
If I provide a list of values corresponding to each fish TDF, can I use multiSpeciesTP() and then pairwiseComparisons()?
If not, I will compute the posterior TP for each fish location and each sample type (muscle/ whole/ fin clip). Is there a way to use pairwiseComparisons in this case? posteriorTP is returning a mcmc.list object that cannot be coerce as a dataframe, and so can't be used with pairwiseComparisons...

Best regards

Denis

Claudio Quezada Romegialli

unread,
Aug 19, 2018, 3:32:47 PM8/19/18
to Denis Lafage, tRophicPosition
Hi Denis

I'm glad you are using tRophicPosition.

Technically, you can't compare two different tissues, because if you have differences between locations or species, you will never know how much is due to differences in tissues or due to intrinsic differences between locations or species. Having said that, you still can compare the trophic position, but I suggest that first you convert fin clips isotope values to muscle isotope values and whole body isotope values to muscle isotope values, then calculate trophic position. If you don't know how those tissues relate each other, then I'm afraid that the pairwise comparisons might be skewed.

pairwiseComparisons() will always work as long as you pass it a list. See this example:

a <- rnorm(100, 2, 0.1)
b <- rnorm(100, 1.8, 0.1)
c <- rnorm(100, 2.2, 0.1)
pairwiseComparisons(list("a" = a, "b" = b, "c" = c))
Here I created a list and used it as argument to pairwiseComparisons. When you use multiSpeciesTP(), you will have a list of 4 elements, in which the third ("TPs") has all the raw posterior trophic position for all species and models, thus you can us it directly as an argument to multiSpeciesTP().

When you use posteriorTP(), as you noted, you have a mcmc object, that depending on how many chains you run, you will have to tweak it a little bit. For example, if you saved in "samples" the results of your model as returned by posteriorTP() use

combined <- coda::mcmc(do.call(rbind, samples))

to combine the different chains of your mcmc object. You should do this for every species/tissue/site, then combine each combined result into a list and use it in pairwiseComparisons.

Please let me know if it works.

Cheers

Claudio



--
To download tRophicPosition package visit https://github.com/clquezada/tRophicPosition
---
You received this message because you are subscribed to the Google Groups "tRophicPosition" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trophicposition-support+unsub...@googlegroups.com.
To post to this group, send email to trophicposition-support@googlegroups.com.
Visit this group at https://groups.google.com/group/trophicposition-support.
To view this discussion on the web, visit https://groups.google.com/d/msgid/trophicposition-support/e08ae5d9-6c38-44d2-aac3-ed783c8c2653%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Dr. Claudio Quezada-Romegialli
Profesor Asociado
Departamento de Biología
Facultad de Ciencias Naturales y Exactas
Universidad de Playa Ancha
Teléfono: +56 32 250 0519

clqu...@ug.uchile.cl

unread,
Aug 19, 2018, 3:42:12 PM8/19/18
to tRophicPosition
Denis

I keep thinking in your TDF approach and it might be a novel way of using different tissues. I have never seen it though. Let mw know if it works.

Cheers

Claudio
Reply all
Reply to author
Forward
0 new messages