In R the PhyloPars package might be interesting. Haven’t used it... though. 
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2703881/
Cheers Franz 

Sent from my mobile

> On 31. Jul 2018, at 21:04, Nicolay Cunha <nicolaycu...@gmail.com> wrote:
> 
> Dear list members,
> 
> I would like to test a linear model between a predictor variable (e.g.
> altitude) and a dependent variable (e.g. number of flowers). For this, I do
> have several observations of individuals of 42 species along the predictor
> variable, but the number of observations do vary per each species and class
> of the independent variable. In the end, I do have 364 observations
> unbalanced per each of the 42 species and environment.
> 
> My intention is doing a model having the number of flower as dependent
> variable, the temperature as fixed effect, using species as a random factor
> and add a phylogenetic correction. I could do part of this this using GLS,
> but the fact of having multiple observations per species do not allow
> running the model and returns the following message:
> 
> 
> *“number of observations and number of tips in the tree are not equal.”*
> I would much appreciate if you could give me advices on how to overcome
> this issue and run such model.
> 
> Many thanks,
> 
> Nicolay
> 
> Grupo de Ecología de la Polinización, INIBIOMA,
> CONICET-Universidad Nacional del Comahue,
> Quintral 1250,  8400 San Carlos de Bariloche, Rio Negro, Argentina
> 
> #**************************************************************************************#
> 
> # Below an example code
> 
> 
> 
> 
> 
> 
> *library(phytools)tree <- rtree(5, rooted = FALSE, tip.label =
> LETTERS[1:5])x <- data.frame(          spp = c(sample(c(LETTERS [1:3]),100,
> replace = T),                     sample(c(LETTERS [2:4]),100, replace =
> T),                     sample(c(LETTERS [3:5]),100, replace = T)),
>  alt = rep(c("1000", "1500", "2000"), each = 100),*
> 
> 
> 
> *          flower = rnorm(300)) library(nlme)fit <- gls(flower ~ alt,
> correlation = corPagel(1,tree, fixed=FALSE), method="ML", data = x) *
> 
> 
> #**************************************************************************************#
> 
>    [[alternative HTML version deleted]]
> 
> _______________________________________________
> R-sig-phylo mailing list - R-sig-phylo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
> Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Reply via email to