Hi Tom.
This is actually not a property of GLS - but of using different
correlation structures when fitting y~x vs. x~y. When you set
correlation=corPagel(...,fixed=FALSE) (the default for corPagel), gls
will fit Pagel's lambda model to the residual error in y|x. The fitted
value of lambda will almost always be different between y|x and x|y.
Since the fitted correlation structure of the residual error is used to
calculate our standard error for beta, this will affect any hypothesis
test about beta.
By contrast, if we assume a fixed error structure (OLS, as in lm; or
correlation=corBrownian(...) - the latter being the same as contrasts
regression), we will find that the P values are the same for y~x vs. x~y.
library(phytools)
library(nlme)
tree<-pbtree(n=100)
x<-fastBM(tree)
# note I have intentionally simulated y without phylogenetic signal
y<-setNames(rnorm(n=100),names(x))
fit.a<-gls(y~x,data.frame(x,y),correlation=corBrownian(1,tree))
summary(fit.a)
fit.b<-gls(x~y,data.frame(x,y),correlation=corBrownian(1,tree))
summary(fit.b)
# fit.a & fit.b should have the same P-values
fit.c<-gls(y~x,data.frame(x,y),correlation=corPagel(1,tree))
summary(fit.c)
fit.d<-gls(x~y,data.frame(x,y),correlation=corPagel(1,tree))
summary(fit.d)
# fit.c & fit.d will most likely have different P-values
All the best, Liam
Liam J. Revell, Assistant Professor of Biology
University of Massachusetts Boston
web: http://faculty.umb.edu/liam.revell/
email: liam.rev...@umb.edu
blog: http://blog.phytools.org
On 7/11/2013 12:03 AM, Tom Schoenemann wrote:
Hi all,
I ran a PGLS with two variables, call them VarA and VarB, using a phylogenetic
tree and corPagel. When I try to predict VarA from VarB, I get a significant
coefficient for VarB. However, if I invert this and try to predict VarB from
VarA, I do NOT get a significant coefficient for VarA. Shouldn't these be both
significant, or both insignificant (the actual outputs and calls are pasted
below)?
If I do a simple lm for these, I get the same significance level for the
coefficients either way (i.e., lm(VarA ~ VarB) vs. lm(VarB ~ VarA), though the
values of the coefficients of course differ.
Can someone help me understand why the PGLS would not necessarily be symmetric
in this same way?
Thanks,
-Tom
outTree_group_by_brain_LambdaEst_redo1 <- gls(log_group_size_data ~
log_brain_weight_data, correlation = bm.t.100species_lamEst_redo1,data =
DF.brain.repertoire.group, method= "ML")
summary(outTree_group_by_brain_LambdaEst_redo1)
Generalized least squares fit by maximum likelihood
Model: log_group_size_data ~ log_brain_weight_data
Data: DF.brain.repertoire.group
AIC BIC logLik
89.45152 99.8722 -40.72576
Correlation Structure: corPagel
Formula: ~1
Parameter estimate(s):
lambda
0.7522738
Coefficients:
Value Std.Error t-value p-value
(Intercept) -0.0077276 0.2628264 -0.029402 0.9766
log_brain_weight_data 0.4636859 0.1355499 3.420778 0.0009
Correlation:
(Intr)
log_brain_weight_data -0.637
Standardized residuals:
Min Q1 Med Q3 Max
-1.7225003 -0.1696079 0.5753531 1.0705308 3.0685637
Residual standard error: 0.5250319
Degrees of freedom: 100 total; 98 residual
Here is the inverse:
outTree_brain_by_group_LambdaEst_redo1 <- gls(log_brain_weight_data ~
log_group_size_data, correlation = bm.t.100species_lamEst_redo1,data =
DF.brain.repertoire.group, method= "ML")
summary(outTree_brain_by_group_LambdaEst_redo1)
Generalized least squares fit by maximum likelihood
Model: log_brain_weight_data ~ log_group_size_data
Data: DF.brain.repertoire.group
AIC BIC logLik
-39.45804 -29.03736 23.72902
Correlation Structure: corPagel
Formula: ~1
Parameter estimate(s):
lambda
1.010277
Coefficients:
Value Std.Error t-value p-value
(Intercept) 1.2244133 0.20948634 5.844836 0.0000
log_group_size_data -0.0234525 0.03723828 -0.629796 0.5303
Correlation:
(Intr)
log_group_size_data -0.095
Standardized residuals:
Min Q1 Med Q3 Max
-2.0682836 -0.3859688 1.1515176 1.5908565 3.1163377
Residual standard error: 0.4830596
Degrees of freedom: 100 total; 98 residual
_________________________________________________
P. Thomas Schoenemann
Associate Professor
Department of Anthropology
Cognitive Science Program
Indiana University
Bloomington, IN 47405
Phone: 812-855-8800
E-mail: t...@indiana.edu
Open Research Scan Archive (ORSA) Co-Director
Consulting Scholar
Museum of Archaeology and Anthropology
University of Pennsylvania
http://www.indiana.edu/~brainevo
[[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/
_______________________________________________
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/