Thank you Simone, I think we're going to first try the model in Rphylopars that accounts for measurement error and intraspecific variation. But we'll check out your JAGS program if that doesn't turn out to be appropriate for our dataset. Best, Ted
-----Original Message----- From: Simone Blomberg [mailto:s.blombe...@uq.edu.au] Sent: Friday, June 12, 2020 1:21 AM To: Theodore Garland <theodore.garl...@ucr.edu>; Ted Stankowich <theodore.stankow...@csulb.edu> Cc: r-sig-phylo@r-project.org; Nicole Lopez <nicole.lope...@student.csulb.edu> 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 all, If you want to go Bayesian, we provide a program in JAGS or BUGS that will do measurement error models incorporating phylogenetic uncertainty. (de Villemereuil et al. BMC Evolutionary Biology 2012, 12:102 http://www.biomedcentral.com/1471-2148/12/102, attached). We took our approach from the book by Carrol et al. which I highly recommend (Carroll RJ, Ruppert D, Stefanski LA: Measurement Error in Nonlinear Models: A Modern Perspective. Boca Raton, FL, USA, London, New York: CRC Press; 2006.). They condemn RMA (or "orthogonal" regression) because although the slope parameters of an ordinary regression are negatively biased in the presence of measurement error, the slopes are even more positively biased if you use orthogonal regression. A properly constructed measurement error model will give unbiased estimates (so long as the assumptions are met.) I think I might have been involved in the discussion on this list about the futility of RMA regression. I still stand by my views. Best, Simone. On 10/6/20 6:49 am, Theodore Garland wrote: > 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 > <theodore.stankow...@csulb.edu> > 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:liam.rev...@umb.edu] >> Sent: Tuesday, June 9, 2020 1:07 PM >> To: Ted Stankowich <theodore.stankow...@csulb.edu>; >> r-sig-phylo@r-project.org >> 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.7891 >>> 11 >>> 52,4:16.33006601):6.360692368,5:22.69076035):5.725388419,(((((6:1.61 >>> 11 >>> 49584,7:1.611149848):1.556474893,8:3.167624477):4.130280196,9:7.2979 >>> 04 >>> 013):1.497063399,10:8.794967413):7.19682079,(11:2.539095678,12:2.539 >>> 09 >>> 6008):13.45269085):12.42436025); >>> >>> >>> >>> Dr. Ted Stankowich >>> Associate Professor >>> Department of Biological Sciences >>> California State University Long Beach Long Beach, CA 90840 >>> theodore.stankow...@csulb.edu<mailto:theodore.stankow...@csulb.edu> >>> 562-985-4826 >>> https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww >>> .c >>> sulb.edu%2Fmammal-lab%2F&data=02%7C01%7Cliam.revell%40umb.edu%7C >>> 5a >>> 74928c910446b96b1508d80caf5765%7Cb97188711ee94425953c1ace1373eb38%7C >>> 0% >>> 7C0%7C637273294515730787&sdata=7FUGnuFJCdRHmPiVrWPPAu%2BLEyK6O%2 >>> B4 >>> VyAKHz1n63qw%3D&reserved=0 >>> @CSULBMammalLab >>> >>> >>> >>> Dr. Ted Stankowich >>> Associate Professor >>> Department of Biological Sciences >>> California State University Long Beach Long Beach, CA 90840 >>> theodore.stankow...@csulb.edu<mailto:theodore.stankow...@csulb.edu> >>> 562-985-4826 >>> https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww >>> .c >>> sulb.edu%2Fmammal-lab%2F&data=02%7C01%7Cliam.revell%40umb.edu%7C >>> 5a >>> 74928c910446b96b1508d80caf5765%7Cb97188711ee94425953c1ace1373eb38%7C >>> 0% >>> 7C0%7C637273294515730787&sdata=7FUGnuFJCdRHmPiVrWPPAu%2BLEyK6O%2 >>> B4 >>> VyAKHz1n63qw%3D&reserved=0 >>> @CSULBMammalLab >>> >>> >>> >>> >>> [[alternative HTML version deleted]] >>> >>> _______________________________________________ >>> R-sig-phylo mailing list - R-sig-phylo@r-project.org >>> https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fst >>> at >>> .ethz.ch%2Fmailman%2Flistinfo%2Fr-sig-phylo&data=02%7C01%7Cliam. >>> re >>> vell%40umb.edu%7C5a74928c910446b96b1508d80caf5765%7Cb97188711ee94425 >>> 95 >>> 3c1ace1373eb38%7C0%7C0%7C637273294515730787&sdata=fM8ulKB00NYkD5 >>> dg >>> 7kKLLn60gKSn7ax30UOS8MoF4qo%3D&reserved=0 >>> Searchable archive at >>> https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww >>> .m >>> ail-archive.com%2Fr-sig-phylo%40r-project.org%2F&data=02%7C01%7C >>> li >>> am.revell%40umb.edu%7C5a74928c910446b96b1508d80caf5765%7Cb97188711ee >>> 94 >>> 425953c1ace1373eb38%7C0%7C0%7C637273294515730787&sdata=TZmy1ZYPY >>> lI >>> l%2FbF4SWD0n7Ivy%2BP8UhB2engQzXg2CVY%3D&reserved=0 >>> > [[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/ -- Simone Blomberg, BSc (Hons), PhD, MAppStat, AStat. Senior Lecturer and Consultant Statistician School of Biological Sciences The University of Queensland St. Lucia Queensland 4072 Australia T: +61 7 3365 2506 email: S.Blomberg1_at_uq.edu.au Twitter: @simoneb66 UQ ALLY Supporting the diversity of sexuality and gender at UQ. Policies: 1. I will NOT analyse your data for you. 2. Your deadline is your problem. Basically, I'm not interested in doing research and I never have been. I'm interested in understanding, which is quite a different thing. And often to understand something you have to work it out for yourself because no one else has done it. - David Blackwell _______________________________________________ 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/