Open emilyklann opened 4 years ago
Hi,
I don't have your data and can't replicate the problem. Here some points to study:
If you use standard univariate R methods, such as linear model lm
, do you get different degrees of freedoms (you should not)? Just keep the right-hand-side of your formula and use any univariate variable as the left-hand-side. The surprising degrees of freedom can happen if you have unbalanced and non-complete design where some of the combinations of Time
, Group
and Cage
are missing. In marginal models, any such missing combination will influence degrees of freedoms of all variables involved. Also, if your variables were not formally defined as factors, they may have been interpreted as continuous variables with only 1 degree of freedom.
It seems that you use distance data as left-hand-side. adonis2
should be able to identify that as distance if (and only if) it is a standard R distance objects (inherits from "dist"
class), or a symmetric square matrix. If it is something non-conforming, adonis2
will mis-identify it as ordinary input data and use it to calculate new dissimilarities of your distances – which really makes no sense. Moreover, if you input distance data, the method
argument should be ignored.
Hello,
Thank you so much for your quick reply! I think that my issue is with an unbalanced design. The sample sizes for each combination are not equal.
Considering this, do you think the results that I am getting are invalid?
Thank you and happy holidays! :)
Emily Klann
Sent from my iPhone
On Dec 21, 2019, at 10:55 AM, Jari Oksanen notifications@github.com wrote:
[External Email]
Hi,
I don't have your data and can't replicate the problem. Here some points to study:
If you use standard univariate R methods, such as linear model lm, do you get different degrees of freedoms (you should not)? Just keep the right-hand-side of your formula and use any univariate variable as the left-hand-side. The surprising degrees of freedom can happen if you have unbalanced and non-complete design where some of the combinations of Time, Group and Cage are missing. In marginal models, any such missing combination will influence degrees of freedoms of all variables involved. Also, if your variables were not formally defined as factors, they may have been interpreted as continuous variables with only 1 degree of freedom.
It seems that you use distance data as left-hand-side. adonis2 should be able to identify that as distance if (and only if) it is a standard R distance objects (inherits from "dist" class), or a symmetric square matrix. If it is something non-conforming, adonis2 will mis-identify it as ordinary input data and use it to calculate new dissimilarities of your distances – which really makes no sense. Moreover, if you input distance data, the method argument should be ignored.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_vegandevs_vegan_issues_338-3Femail-5Fsource-3Dnotifications-26email-5Ftoken-3DAKGNL3Z6T6QD5G4WNQLNAKLQZY36XA5CNFSM4J6CCWVKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHO6SBA-23issuecomment-2D568191236&d=DwMFaQ&c=sJ6xIWYx-zLMB3EPkvcnVg&r=3LF_9N64-1SumLL1G7toeLLDe_71zrDPvsIeyNcEjGU&m=AGkwZbMe9E1V8UuULsv8i5-CEUTYBhq7eWPrau9vLD4&s=-XojMS6Ogd9EVMO0xBeufcDgzKqK5bjAUtbxp363eXc&e=, or unsubscribehttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AKGNL37WX4HR54GITCO3LTDQZY36XANCNFSM4J6CCWVA&d=DwMFaQ&c=sJ6xIWYx-zLMB3EPkvcnVg&r=3LF_9N64-1SumLL1G7toeLLDe_71zrDPvsIeyNcEjGU&m=AGkwZbMe9E1V8UuULsv8i5-CEUTYBhq7eWPrau9vLD4&s=OSdJnj10dDuQu7Dx4uNnCGh34952VPoVCLtTsaFi5hs&e=.
Hello,
I am relatively new to using vegan (and to analyzing microbiome data in general). I apologize if this seems like a silly question.
I am using adonis2 to test for significance between unifrac measures for two groups over time (treatment and controls). However, I also want to take into account the variance due to cage effects. My model looks like this:
From what I could tell by reading information about adonis2, adding "by=margin", seems to allow for all variables to be taken into account evenly (not sequentially as with "by=terms"). Therefore, I would assume that the output would be similar to that of a standard regression. However, the degrees of freedom for the degrees of freedom and the R-squared value for my 'Group' variable is zero and the F-value is -Inf. Further, the degrees of freedom for my 'Cage' variable is one less than it should be.
I thought that maybe the zeros for the 'Group' variable simply meant that it does not contribute to or explain any of the observed variance. However, this doesn't explain the discrepancy with the degrees of freedom. I hope this makes sense. Any help in understanding how this function works with the "by=margin" option would be much appreciated!