Re: [R-sig-phylo] Rphylopars changing observed data values

2020-07-20 Thread Julien Clavel
Dear Nick,

Although within-species error is not treated in the same way as in Rphylopars 
you can also impute missing values (and estimate ancestral states) for most 
multivariate models implemented in mvMORPH using the "estim" function (see 
?estim).

Best wishes,

Julien

De : R-sig-phylo  de la part de Liam J. 
Revell 
Envoyé : lundi 20 juillet 2020 18:47
À : Nick Crouch ; r-sig-phylo@r-project.org 

Objet : Re: [R-sig-phylo] Rphylopars changing observed data values 
 
Dear Nick.

I don't know what's going on with Rphylopars, but phytools also has a 
multivariate phylogenetic imputation function, phylo.impute. It's 
described here on my blog: 
http://blog.phytools.org/2019/03/phylogenetic-imputation-with.html 
(although, of course you should use the phytools version not the posted 
code).

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 7/16/2020 10:47 AM, Nick Crouch wrote:
> [EXTERNAL SENDER]
> 
> Hi all,
> 
> I'm trying to use Rphylopars to impute some missing data, but am having some 
> strange results with my empirical data.
> 
> The phylopars should return a `data.frame` of the original data with the 
> missing (NA) values calculated given the phylogenetic data and evolutionary 
> model. However, my known values are being changed in the output. For example:
> 
>> head(empirical.data)
> species    Trait
> 1   Species_1   14.0
> 2   Species_2   12.0
> 
>> head(p_BM$anc_recon)
> species    Trait
> 1   Species_1   12.0
> 2   Species_2   8.9
> 
> The function works fine when I use different combinations of simulated data:
> * simulated traits + simulated phylogeny works fine
> * simulated traits + empirical phylogeny works fine
> * empirical data + simulated phylogeny works fine
> 
> The phylogeny has no 0 branch lengths, is binary, and ultrametric. I have 
> tried log-transforming the data. I have also tried sequentially dropping one 
> tip at a time from the tree and re-running to see if any single tip is 
> causing the problem. Different models also have the same effect.
> 
> If anyone has any thoughts i'd appreciate it.
> 
> Nick
> 
> --
> 
> Nick Crouch
> https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fnickcrouch.github.io%2Fdata=02%7C01%7Cliam.revell%40umb.edu%7Cfb9cae70c8884b194ba308d82cc914ca%7Cb97188711ee94425953c1ace1373eb38%7C0%7C1%7C637308589448752383sdata=hXkX5aboOGy3cJaK6QZBYAnm3kNrs%2Fqj2hAocX9MTKU%3Dreserved=0
> Postdoctoral scholar, Jablonski lab
> The University of Chicago
> 
>  [[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%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-sig-phylodata=02%7C01%7Cliam.revell%40umb.edu%7Cfb9cae70c8884b194ba308d82cc914ca%7Cb97188711ee94425953c1ace1373eb38%7C0%7C1%7C637308589448752383sdata=VO6CC1WW3FuZg3geh0vZAL7NADKfHuxXxftuMW%2FTic4%3Dreserved=0
> Searchable archive at 
> https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.mail-archive.com%2Fr-sig-phylo%40r-project.org%2Fdata=02%7C01%7Cliam.revell%40umb.edu%7Cfb9cae70c8884b194ba308d82cc914ca%7Cb97188711ee94425953c1ace1373eb38%7C0%7C1%7C637308589448762381sdata=skztD9PMN5AVLUr03a1TXg2iNjWL9Aw5NvA3aYCvoyg%3Dreserved=0
>

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


Re: [R-sig-phylo] Rphylopars changing observed data values

2020-07-20 Thread Liam J. Revell

Dear Nick.

I don't know what's going on with Rphylopars, but phytools also has a 
multivariate phylogenetic imputation function, phylo.impute. It's 
described here on my blog: 
http://blog.phytools.org/2019/03/phylogenetic-imputation-with.html 
(although, of course you should use the phytools version not the posted 
code).


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 7/16/2020 10:47 AM, Nick Crouch wrote:

[EXTERNAL SENDER]

Hi all,

I'm trying to use Rphylopars to impute some missing data, but am having some 
strange results with my empirical data.

The phylopars should return a `data.frame` of the original data with the 
missing (NA) values calculated given the phylogenetic data and evolutionary 
model. However, my known values are being changed in the output. For example:


head(empirical.data)

speciesTrait
1   Species_1   14.0
2   Species_2   12.0


head(p_BM$anc_recon)

speciesTrait
1   Species_1   12.0
2   Species_2   8.9

The function works fine when I use different combinations of simulated data:
* simulated traits + simulated phylogeny works fine
* simulated traits + empirical phylogeny works fine
* empirical data + simulated phylogeny works fine

The phylogeny has no 0 branch lengths, is binary, and ultrametric. I have tried 
log-transforming the data. I have also tried sequentially dropping one tip at a 
time from the tree and re-running to see if any single tip is causing the 
problem. Different models also have the same effect.

If anyone has any thoughts i'd appreciate it.

Nick

--

Nick Crouch
https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fnickcrouch.github.io%2Fdata=02%7C01%7Cliam.revell%40umb.edu%7Cfb9cae70c8884b194ba308d82cc914ca%7Cb97188711ee94425953c1ace1373eb38%7C0%7C1%7C637308589448752383sdata=hXkX5aboOGy3cJaK6QZBYAnm3kNrs%2Fqj2hAocX9MTKU%3Dreserved=0
Postdoctoral scholar, Jablonski lab
The University of Chicago

 [[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%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-sig-phylodata=02%7C01%7Cliam.revell%40umb.edu%7Cfb9cae70c8884b194ba308d82cc914ca%7Cb97188711ee94425953c1ace1373eb38%7C0%7C1%7C637308589448752383sdata=VO6CC1WW3FuZg3geh0vZAL7NADKfHuxXxftuMW%2FTic4%3Dreserved=0
Searchable archive at 
https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.mail-archive.com%2Fr-sig-phylo%40r-project.org%2Fdata=02%7C01%7Cliam.revell%40umb.edu%7Cfb9cae70c8884b194ba308d82cc914ca%7Cb97188711ee94425953c1ace1373eb38%7C0%7C1%7C637308589448762381sdata=skztD9PMN5AVLUr03a1TXg2iNjWL9Aw5NvA3aYCvoyg%3Dreserved=0



___
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] Rphylopars changing observed data values

2020-07-20 Thread Nick Crouch
Hi all,

I'm trying to use Rphylopars to impute some missing data, but am having some 
strange results with my empirical data.

The phylopars should return a `data.frame` of the original data with the 
missing (NA) values calculated given the phylogenetic data and evolutionary 
model. However, my known values are being changed in the output. For example:

> head(empirical.data)
   speciesTrait
1   Species_1   14.0
2   Species_2   12.0

> head(p_BM$anc_recon)
   speciesTrait
1   Species_1   12.0
2   Species_2   8.9

The function works fine when I use different combinations of simulated data:
* simulated traits + simulated phylogeny works fine
* simulated traits + empirical phylogeny works fine
* empirical data + simulated phylogeny works fine

The phylogeny has no 0 branch lengths, is binary, and ultrametric. I have tried 
log-transforming the data. I have also tried sequentially dropping one tip at a 
time from the tree and re-running to see if any single tip is causing the 
problem. Different models also have the same effect.

If anyone has any thoughts i'd appreciate it.

Nick

--

Nick Crouch
http://nickcrouch.github.io/
Postdoctoral scholar, Jablonski lab
The University of Chicago

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