[R-sig-phylo] mixed models in phyreg

2017-04-28 Thread Ivalu Cacho
Hi All,

I get the error and output below when running mixed models in phyreg. Anyone 
has an idea of what does this mean? Data consists of one continuous and one 
categorical independent variables. I am interested in testing their effects and 
interaction. There’s no missing data, and data are normally distributed.

Thank y’all.
-Ivalu



This is the command:
m2 <- phyreg(var1~ var2, test= “cat1", data=new.data, phydata= phyconverted 
$phy, heightsdata= phyconverted$hts)


This is the error and output:
Some ftriple is NA
Called from: findmax(lorho, hirho, minrho, errrho)
Browse[1]> 
debug: surround <- function() {
while ((ftriple[1] > ftriple[2]) && (xtriple[3] > xmin)) {
newxlo <- xtriple[1]^2/xtriple[2]
newflo <- getlik(newxlo)
xtriple[3] <<- xtriple[2]
xtriple[2] <<- xtriple[1]
xtriple[1] <<- newxlo
ftriple[3] <<- ftriple[2]
ftriple[2] <<- ftriple[1]
ftriple[1] <<- newflo
}
while (ftriple[3] > ftriple[2]) {
newxhi <- xtriple[3]^2/xtriple[2]
newfhi <- getlik(newxhi)
xtriple[1] <<- xtriple[2]
xtriple[2] <<- xtriple[3]
xtriple[3] <<- newxhi
ftriple[1] <<- ftriple[2]
ftriple[2] <<- ftriple[3]
ftriple[3] <<- newfhi
}
}
Browse[2]> 
debug: try <- function(xtriple, ftriple, xmid, fmid, lopos, hipos) {
if (fmid > ftriple[2]) {
xtriplo <- xtriple[lopos]
xtriphi <- xtriple[hipos]
xtriple[1] <<- xtriplo
xtriple[2] <<- xmid
xtriple[3] <<- xtriphi
ftriplo <- ftriple[lopos]
ftriphi <- ftriple[hipos]
ftriple[1] <<- ftriplo
ftriple[2] <<- fmid
ftriple[3] <<- ftriphi
return(1)
}
else {
return(0)
}
}
Browse[2]> 
debug: centre <- function(xtriple, ftriple, lxmid, lfmid, rxmid, rfmid) {
xtriple[1] <<- lxmid
xtriple[3] <<- rxmid
ftriple[1] <<- lfmid
ftriple[3] <<- rfmid
}
Browse[2]> 
debug: bizarretry <- surround()
Browse[2]> 
Error in while ((ftriple[1] > ftriple[2]) && (xtriple[3] > xmin)) { : 
  missing value where TRUE/FALSE needed
In addition: Warning messages:
1: In log(ssterm) : NaNs produced
2: In log(ssterm) : NaNs produced
3: In log(ssterm) : NaNs produced

___
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/

Re: [R-sig-phylo] Bug in ape?

2017-04-28 Thread François Michonneau
Hi Simon and others,

  I ran into the same problems a few days ago and I suspect it's
related to changes associated with R 3.4.0. Re-installing ape solved
the issue for me.

  Cheers,
  -- François

On Wed, Apr 26, 2017 at 11:01 PM, Simon Blomberg  wrote:
> False alarm. I cleared my workspace and re-started R and the problem has
> gone away. I'm curious to know how it occurred but I'm happy that it has
> been resolved. We now return you to your scheduled R programming...
>
> Cheers,
>
> Simon.
>
>
>
> On 27/04/17 12:44, Simon Blomberg wrote:
>>
>> Hi Emmanuel and other list members.
>>
>> I am having some problems creating and working with trees (phylo objects)
>> in ape. Has anyone else seen this error? The following code reproduces the
>> errors:
>>
>> library(ape)
>> tr1 <- rtree(10)
>>
>> plot(tr1)
>>
>> Error in .reorder_ape(x, order, index.only, length(x$tip.label), io) :
>>   object 'neworder_phylo' not found
>>
>> tr2 <- rcoal(10)
>>
>> Error in .reorder_ape(x, order, index.only, length(x$tip.label), io) :
>>   object 'neworder_phylo' not found
>>
>> tr3 <- read.tree(text="((a, b), (c, d));")
>>
>> compute.brlen(tr3)
>>
>> Error in .reorder_ape(x, order, index.only, length(x$tip.label), io) :
>>   object 'neworder_phylo' not found
>>
>> ## All have the same traceback:
>>
>> > traceback()
>> 4: .reorder_ape(x, order, index.only, length(x$tip.label), io)
>> 3: reorder.phylo(phy, "postorder")
>> 2: reorder(phy, "postorder")
>> 1: compute.brlen(tr3)
>>
>> > sessionInfo()
>>
>> R version 3.4.0 (2017-04-21)
>> Platform: x86_64-pc-linux-gnu (64-bit)
>> Running under: Ubuntu 17.04
>>
>> Matrix products: default
>> BLAS: /usr/lib/openblas-base/libblas.so.3
>> LAPACK: /usr/lib/libopenblasp-r0.2.19.so
>>
>> locale:
>>  [1] LC_CTYPE=en_AU.UTF-8   LC_NUMERIC=C
>>  [3] LC_TIME=en_AU.UTF-8LC_COLLATE=en_AU.UTF-8
>>  [5] LC_MONETARY=en_AU.UTF-8LC_MESSAGES=en_AU.UTF-8
>>  [7] LC_PAPER=en_AU.UTF-8   LC_NAME=C
>>  [9] LC_ADDRESS=C   LC_TELEPHONE=C
>> [11] LC_MEASUREMENT=en_AU.UTF-8 LC_IDENTIFICATION=C
>>
>> attached base packages:
>> [1] stats graphics  grDevices utils datasets  methods base
>>
>> other attached packages:
>> [1] ape_4.1
>>
>> loaded via a namespace (and not attached):
>>  [1] Rcpp_0.12.10 magrittr_1.5 splines_3.4.0 MASS_7.3-47
>>  [5] munsell_0.4.3colorspace_1.3-2 lattice_0.20-35 minqa_1.2.4
>>  [9] stringr_1.2.0glmmADMB_0.8.3.3 plyr_1.8.4 tcltk_3.4.0
>> [13] tools_3.4.0  parallel_3.4.0   nnet_7.3-12 grid_3.4.0
>> [17] nlme_3.1-131 gtable_0.2.0 coda_0.19-1 fortunes_1.5-4
>> [21] lme4_1.1-13  lazyeval_0.2.0   tibble_1.3.0 Matrix_1.2-8
>> [25] R2admb_0.7.15nloptr_1.0.4 ggplot2_2.2.1 effects_3.1-2
>> [29] stringi_1.1.5compiler_3.4.0   scales_0.4.1
>>
>> I am not getting the error on two other machines with the same OS and (as
>> far as I can tell) the same setup. Any help would be greatly appreciated!
>>
>> Cheers,
>>
>> Simon.
>>
>
> --
> Simon 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
> http://www.evolutionarystatistics.org
>
> 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/

___
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/