Hi Jaime,

Yes, (p)gls regressions can handle categorical and/or continuous predictors in 
the same way as conventional regressions do. The (p)gls regressions differ from 
conventional one (ols) by relaxing the hypothesis of independance (and 
homoscedasticity) of the residuals. 

Regarding which one is better, this depends on the phylogenetic or 
autocorrelation structure in the residuals of the model fit. Sometimes the use 
of a gls regression based on a wrong model for our data (e.g. the default 
Brownian motion option in (p)gls) can be worse than using ols regression. 
Typically, this can't be known before hand.

In practical terms, I think that using models more flexible than brownian 
motion (BM) - i.e. models that can jointly estimate/accommodate the structure 
in the residuals of the regression such as OU or Pagel's lambda/mixed models - 
are usually better because they can handle scenarios ranging from no 
autocorrelation (ols) to various levels of phylogenetic signal (including BM). 
In this sense, the use of (p)gls regressions can be considered as generally 
better.

There's also implementations in "phylolm" package, or "ape/nlme" that also 
allow the use of various models for the residuals structure.

Best wishes,

Julien

________________________________________
De : R-sig-phylo <r-sig-phylo-boun...@r-project.org> de la part de JAIME ADRIAN 
CORDOVA <jaime.cord...@wisc.edu>
Envoyé : mercredi 19 juin 2024 20:46
À : r-sig-phylo@r-project.org <r-sig-phylo@r-project.org>
Objet : [R-sig-phylo] Predictor types for caper:pgls
 
Hi all,

I'm using the caper package to run some pgls regressions, with the goal of 
understanding if the species being studied has any relation to the growth rates 
(e.g. Does being an E. Coli strain mean it grows better in our environments of 
interest than if it was Salmonella?)

Can a categorical predictor be included in the pgls function of caper? Whether 
it would be on its own (continuous ~ categorical) or with a continuous 
predictor (continuous ~ continuous + categorical). I recognize that the brunch 
function is available but I would like to do this using pgls. From what I 
understand, pgls is better?

Thanks!

Kind regards,
Jaime

Jaime A. Cordova Jr.
Pronouns: he/him/his/�l
Genetics PhD Candidate, Perna Lab
University of Wisconsin, Madison


        [[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