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

contrastsTest issue #130

Closed
msmcfarlin opened this issue Feb 2, 2022 · 1 comment
Closed

contrastsTest issue #130

msmcfarlin opened this issue Feb 2, 2022 · 1 comment

Comments

@msmcfarlin
Copy link

Hi @bryandmartin,

I am interested in pairwise contrasts, as mentioned in #126, and ran into an issue with contrastsTest. To give an example, if I have a test with...

soil_family <- tax_glom(soil_phylo, "Family")

da_analysis.small <- contrastsTest(formula = ~ DayAmdmt,
                             phi.formula = ~ DayAmdmt,
                             contrasts_DA = list("DayAmdmt21 - DayAmdmt11",
                                                 "DayAmdmt21 - DayAmdmt00"),
                             data = soil_family,
                             fdr_cutoff = 0.05)

Then I get an "NA" for all comparisons between "DayAmdmt21 - DayAmdmt00". Is this an error with how the DayAmdmt00 is specified in the contrasts_DA?

I am interested in this for pairwise contrasts, i.e. 1v2, 1v3, 2v3, etc.

Thanks!
-Mike

@bryandmartin
Copy link
Collaborator

Hi @msmcfarlin ,

This is because contrastsTest looks at the coefficients from the model. In the model you are fitting, DayAmdmt00 is the baseline value of DayAmdmt, so there is no coefficient here. To include a baseline value, you can just treat it like a coefficient of 0. Hence, instead of DayAmdmt21 - DayAmdmt00, you can just use DayAmdmt21 to make this contrast.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants