ericgoolsby / Rphylopars

Phylogenetic Comparative Tools for Missing Data and Within-Species Variation
28 stars 11 forks source link

Question regarding confidence intervals from phylopars function #56

Open aeiche01 opened 9 months ago

aeiche01 commented 9 months ago

Is it appropriate to calculate confidence intervals around derived average values from the phylopars function using the mean for each species from anc_recon, variance from each species from anc_var, and original sample size of each species? I note that we can calculate confidence intervals around the covariates with an argument get_cov_CIs, but not around the derived species averages. Not sure if that means we shouldn't do that at all.

Apologies if this is a silly question, I'm still getting a handle on how this works!

ericgoolsby commented 9 months ago

This is a great question, and apologies for the lack of clarifying documentation! The get_cov_CIs argument was a relatively recent add-on that was requested for a specific project, but it is absolutely appropriate to use the quantities from anc_recon and anc_var to compute CIs around species-level (ancestral or imputed) means. There is a very brief demo here on the wiki but it really should be spelled out in the package help files.

If you're interested in missing data imputation, I should also mention that if you have multiple observations per species, you can get the individual-level estimates too (ind_recon). Apparently I never included the individual-level variances, but if you needed those quantities for individual-level CIs, that would be fairly straightforward to implement in the next update!

aeiche01 commented 9 months ago

This is perfect, thank you! I do have missing data that I'm imputing but I don't need CIs at the individual level (just at the species level), but it's useful to know that we can also get CIs for that as well if necessary. I would definitely endorse putting a how-to for calculating CIs in the package help file

jakeberv commented 8 months ago

Apparently I never included the individual-level variances, but if you needed those quantities for individual-level CIs, that would be fairly straightforward to implement in the next update!

I would be interested in this!