Right – I was saying it’s more of an issue with interpretation and comparing 
with past studies, many of which don’t even incorporate phylogenetic methods 
(traditional regression).
I found the Rphylopars package in R, which appears to consider both 
intraspecific variation and measurement error (or at least multiple 
measurements of the same species).
https://cran.r-project.org/web/packages/Rphylopars/Rphylopars.pdf

Best,
Ted

From: Theodore Garland [mailto:[email protected]]
Sent: Tuesday, June 9, 2020 1:49 PM
To: Ted Stankowich <[email protected]>
Cc: Liam J. Revell <[email protected]>; [email protected]; Nicole 
Lopez <[email protected]>
Subject: Re: [R-sig-phylo] phyl.RMA error

CAUTION: This email was sent from an external source. Use caution when 
replying, opening links or attachments.

A slope from RMA will always be > than the corresponding OLS slope because RMA 
= OLS/r, where r is the correlation coefficient.
And note that the RMA slope calculated this way is undefined if r = 0.

This is why you want to use measurement-error models.

Cheers,
Ted





On Tue, Jun 9, 2020 at 1:34 PM Ted Stankowich 
<[email protected]<mailto:[email protected]>> wrote:
Thank you Liam and Ted!
That worked. I've never named my data columns this way and when I call 
names(Data), it does give me the column names "Binomial", "Skull", and "Tusk". 
This method appears to pull out the vectors and use them outside of the 
original dataframe, is this a particular requirement/feature of phyl.RMA?

Regarding RMA vs. other methods, this is a study of allometry of tusks and 
antlers. In our first submission of this project we got raked over the coals 
for only using OLS methods so we're doing both OLS and RMA this time around, 
but are struggling to interpret the slope discrepancies between the two methods 
(RMA always returns larger slopes). There is measurement error in our 
independent factor (Skull) since some of those data come from PCA estimates 
based on landmark measures in skulls that were broken/partial (full skull 
length wasn't possible). We'll definitely look at the paper Ted posted though. 
There appears to be some strong divergent methodological opinions among the 
allometry community though, so it's hard to know the best way to proceed!

Thanks!
-Ted



-----Original Message-----
From: Liam J. Revell [mailto:[email protected]<mailto:[email protected]>]
Sent: Tuesday, June 9, 2020 1:07 PM
To: Ted Stankowich 
<[email protected]<mailto:[email protected]>>; 
[email protected]<mailto:[email protected]>
Subject: Re: [R-sig-phylo] phyl.RMA error

CAUTION: This email was sent from an external source. Use caution when 
replying, opening links or attachments.


Hi Ted.

It's a good bet that your input vectors, log(Skull) and log(Tusk), don't have 
names.

In your case, if your data frame is called Data, you might first compute:

ln.Skull<-setNames(log(Data$Skull),Data$Binomial)
ln.Tusk<-setNames(log(Data$Tusk),Data$Binomial)

and then run:

Model<-phyl.RMA(ln.Skull,ln.Tusk,tree,h0=1.0)
Model
plot(Model) ## this is kind of cool.

Note, that as pointed out in the documentation of the function: "some 
statistician think there is never a condition in which a reduced-major-axis 
regression should be used" (I believe this has even been discussed on this 
list); and "The statistical hypothesis testing is based on Clarke (1980; 
reviewed in McArdle 1988), which differs from some other implementations of 
non-phylogenetic major axis regression in R."

All the best, Liam

Liam J. Revell
Associate Professor, University of Massachusetts Boston Profesor Asistente, 
Universidad Católica de la Ssma Concepción
web: http://faculty.umb.edu/liam.revell/, http://www.phytools.org

Academic Director UMass Boston Chile Abroad:
https://www.umb.edu/academics/caps/international/biology_chile

On 6/8/2020 4:18 PM, Ted Stankowich wrote:
> [EXTERNAL SENDER]
>
> Hello,
>
> We're trying to run phylogenetically corrected reduced major axes regression 
> analyses and have encountered an error we can't debug. We're using the 
> function phyl.RMA in the package 'phytools'. Here is the code we are using 
> and the error it returns.
>
>
>
>> Model <- phyl.RMA(log(Skull), log(Tusk), tree, h0=1.0)
>
> Error in if (sign(beta1) != sign(h0)) { :
>
>    missing value where TRUE/FALSE needed
>
> We can't seem to figure out which argument is missing, and we've tried 
> including all of the T/F based arguments we think are possible. Our species 
> dataset and nexus file are printed below.  Any advice would be greatly 
> appreciated.
>
> We have the following dataset:
> Binomial                 Skull  Tusk
>     <chr>                    <dbl> <dbl>
> 1 Tragulus_javanicus        93.7  14.6
> 2 Tragulus_kanchil          99.7  13.9
> 3 Tragulus_napu             98.1  11.1
> 4 Tragulus_nigricans        99.8  13.2
> 5 Moschiola_meminna        101.   14.6
> 6 Moschus_berezovskii      134.   55.0
> 7 Moschus_moschiferus      152.   52.9
> 8 Muntiacus_muntjak        193.   26.4
> 9 Muntiacus_reevesi        159.   23.4
> 10 Muntiacus_truongsonensis 184.   27.7
> 11 Muntiacus_vaginalis      203.   28.6
> 12 Hydropotes_inermis       162.   48.5
> 13 Hyemoschus_aquaticus     122.   20.1
> 14 Elaphodus_cephalophus    186.   17.3
>
> And the following nexus tree:
>
> #NEXUS
> [R-package APE, Mon Jun 08 12:20:01 2020]
>
> BEGIN TAXA;
>                DIMENSIONS NTAX = 12;
>                TAXLABELS
>                               Tragulus_napu
>                               Tragulus_kanchil
>                               Tragulus_javanicus
>                               Hyemoschus_aquaticus
>                               Moschiola_meminna
>                               Muntiacus_reevesi
>                               Muntiacus_muntjak
>                               Muntiacus_truongsonensis
>                               Elaphodus_cephalophus
>                               Hydropotes_inermis
>                               Moschus_moschiferus
>                               Moschus_berezovskii
>                ;
> END;
> BEGIN TREES;
>                TRANSLATE
>                               1            Tragulus_napu,
>                               2            Tragulus_kanchil,
>                               3            Tragulus_javanicus,
>                               4            Hyemoschus_aquaticus,
>                               5            Moschiola_meminna,
>                               6            Muntiacus_reevesi,
>                               7            Muntiacus_muntjak,
>                               8            Muntiacus_truongsonensis,
>                               9            Elaphodus_cephalophus,
>                               10          Hydropotes_inermis,
>                               11          Moschus_moschiferus,
>                               12          Moschus_berezovskii
>                ;
>                TREE * UNTITLED = [&R]
> ((((1:5.540957781,(2:2.978817423,3:2.978817423):2.562139698):10.789111
> 52,4:16.33006601):6.360692368,5:22.69076035):5.725388419,(((((6:1.6111
> 49584,7:1.611149848):1.556474893,8:3.167624477):4.130280196,9:7.297904
> 013):1.497063399,10:8.794967413):7.19682079,(11:2.539095678,12:2.53909
> 6008):13.45269085):12.42436025);
>
>
>
> Dr. Ted Stankowich
> Associate Professor
> Department of Biological Sciences
> California State University Long Beach Long Beach, CA 90840
> [email protected]<mailto:[email protected]><mailto:[email protected]<mailto:[email protected]>>
> 562-985-4826
> https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.c
> sulb.edu<http://sulb.edu>%2Fmammal-lab%2F&amp;data=02%7C01%7Cliam.revell%40umb.edu<http://40umb.edu>%7C5a
> 74928c910446b96b1508d80caf5765%7Cb97188711ee94425953c1ace1373eb38%7C0%
> 7C0%7C637273294515730787&amp;sdata=7FUGnuFJCdRHmPiVrWPPAu%2BLEyK6O%2B4
> VyAKHz1n63qw%3D&amp;reserved=0
> @CSULBMammalLab
>
>
>
> Dr. Ted Stankowich
> Associate Professor
> Department of Biological Sciences
> California State University Long Beach Long Beach, CA 90840
> [email protected]<mailto:[email protected]><mailto:[email protected]<mailto:[email protected]>>
> 562-985-4826
> https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.c
> sulb.edu<http://sulb.edu>%2Fmammal-lab%2F&amp;data=02%7C01%7Cliam.revell%40umb.edu<http://40umb.edu>%7C5a
> 74928c910446b96b1508d80caf5765%7Cb97188711ee94425953c1ace1373eb38%7C0%
> 7C0%7C637273294515730787&amp;sdata=7FUGnuFJCdRHmPiVrWPPAu%2BLEyK6O%2B4
> VyAKHz1n63qw%3D&amp;reserved=0
> @CSULBMammalLab
>
>
>
>
>          [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-phylo mailing list - 
> [email protected]<mailto:[email protected]>
> https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat
> .ethz.ch<http://ethz.ch>%2Fmailman%2Flistinfo%2Fr-sig-phylo&amp;data=02%7C01%7Cliam.re
> vell%40umb.edu<http://40umb.edu>%7C5a74928c910446b96b1508d80caf5765%7Cb97188711ee9442595
> 3c1ace1373eb38%7C0%7C0%7C637273294515730787&amp;sdata=fM8ulKB00NYkD5dg
> 7kKLLn60gKSn7ax30UOS8MoF4qo%3D&amp;reserved=0
> Searchable archive at
> https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.m
> ail-archive.com<http://ail-archive.com>%2Fr-sig-phylo%40r-project.org<http://40r-project.org>%2F&amp;data=02%7C01%7Cli
> am.revell%40umb.edu<http://40umb.edu>%7C5a74928c910446b96b1508d80caf5765%7Cb97188711ee94
> 425953c1ace1373eb38%7C0%7C0%7C637273294515730787&amp;sdata=TZmy1ZYPYlI
> l%2FbF4SWD0n7Ivy%2BP8UhB2engQzXg2CVY%3D&amp;reserved=0
>

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-phylo mailing list - [email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/[email protected]/

Reply via email to