Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

intra_physig problem with se argument #182

Closed
caterinap opened this issue Jan 16, 2018 · 4 comments
Closed

intra_physig problem with se argument #182

caterinap opened this issue Jan 16, 2018 · 4 comments

Comments

@caterinap
Copy link
Collaborator

caterinap commented Jan 16, 2018

phytools::phylosig has already the possibility to include intraspecific variation/error using the method from Ives et al. (2007). If people decide to try to use both Ives method and "our method", the function does not work. This is because when you specify the error argument in phylosig (se), the output from phylosig is different.

For now the fastest would be to just add this information in the help (i.e. that one cannot use both things) but in future we might want to solve this problem by throwing an error.

Also, I just noticed that we should remove the following from the help:

Currently, this function can only implement simple linear models (i.e. \eqn{trait~ predictor}). In the future we will implement more complex models.

And change title which is:

Intraspecific variability - Phylogenetic Linear Regression

We should also check if this appears in other phylo signal functions.

The code, if you want to see what happens:

library(sensiPhy)
library(phytools)
data(alien)
intra <- intra_physig(trait.col = "gestaLen", V = "SD_gesta" , data = alien.data, phy = alien.phy[[1]],n.intra=4,se="SD_gesta)

tree<-pbtree(n=100)
x<-fastBM(tree)
y <- x/2
phylosig(tree,x,method="lambda",test=TRUE)
phylosig(tree,x,method="lambda",test=TRUE,se=y) #this is Ives method
@paternogbc
Copy link
Owner

paternogbc commented Jan 16, 2018 via email

@caterinap
Copy link
Collaborator Author

Just checked, the sentence about linear models in documentation does not appear in other phylosig functions.

paternogbc added a commit that referenced this issue Jan 20, 2018
Excluded mistaken sentense from help. Fix issue #182
@paternogbc
Copy link
Owner

Hey guys,

have excluded these sentences and fixed the issue of "se" by simply removing the "..." further argument being passed from 'intra_physig' to 'phylosig'.

intra_physig <- function(trait.col, data, phy,
                        V = NULL, n.intra = 100, distrib = "normal",
                        method = "K", track = TRUE){

Now the following code gives an error (unused argument).

library(sensiPhy)
library(phytools)
data(alien)
intra <- intra_physig(trait.col = "gestaLen", V = "SD_gesta" , 
                      data = alien.data, phy = alien.phy[[1]],n.intra=4, se = "SD_gesta")
Error in intra_physig(trait.col = "gestaLen", V = "SD_gesta", data = alien.data,  : 
  unused argument (se = "SD_gesta")

@paternogbc
Copy link
Owner

Perhaps we skip the "..." and include all important arguments directly in our functions. (maybe implement in all sensiPhy functions).

paternogbc added a commit that referenced this issue Jan 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants