On Fri, 2011-11-25 at 09:30 +0000, Gavin Simpson wrote: > On Sun, 2011-11-20 at 03:37 +0000, [email protected] wrote: > > Thanks all for your help on adonis!!!^_^ > > Thanks Kay too...;-) > > > > > > So,I have moved on and currently working on betadisper and faced some > > problems. > > > > 1.In vegatutor.pdf, betadisper (pg 33), "The function can only use one > > factor as an independent variable, and it does not know the formula > > interface,..." > > > > mod <- with(dune.env, betadisper(betad, Management)) > > > > Let's say I need to investigate the interaction of factors: Management and > > USE. My question is: Can i create a new factor from the interaction of > > factor Management and USE then use it in betadisper()? E.g. > > > > groupA<-interaction(dune.env$Management,dune.env$Use) > > mod <- with(dune.env, betadisper(betad, groupA)) > > mod > > > > Error in optim(apply(X, 2, median, na.rm = TRUE), fn = medfun, gr = > > dmedfun, : > > non-finite value supplied by optim > > That interaction is generating groups with 1 or even 0 entries: > > > table(groupA) > groupA > BF.Hayfield HF.Hayfield NM.Hayfield SF.Hayfield BF.Haypastu HF.Haypastu > 1 2 4 0 1 1 > NM.Haypastu SF.Haypastu BF.Pasture HF.Pasture NM.Pasture SF.Pasture > 1 5 1 2 1 1 > > which will be the source of the error. I haven't tracked this through > the code as yet, but we should be able to detect this and stop or even > drop the empty levels if it is just those 0 groups that are causing the > problem. > Howdy Folks,
It seems that empty groups (count is zero) are the source of the problem. You can drop them using factor() command for your interaction -- this drops empty levels: mod <- betadisper(betad, factor(groupA)) works for me. However, like Gav said, this may not be a meaningful test (but still calls for a fix in vegan). If I remember correctly, Marti Anderson had interactions in her software, but that was dropped from current versions. Cheers, jari oksanen > > For the dune dataset, the above error occured. But for my data, the > > interaction works. I wonder if i continue to use the new factor generated > > from the factor-interaction for the betadisper, will it affects the > > results? If this is wrong, what would be the recommended function to use? > > I would need to check more carefully, but this may not be what Marti > Anderson's software would fit as an interaction model. I may be > misremembering, but IIRC PERMDISP can handle two-way ANOVA type models > within her framework and betadisper is not set-up for that. What you > have done is look at whether certain combinations of your two factors of > interest are more variable/dispersed than others. Which seems a > reasonable hypothesis to me. > > G > > > Sincerely Yours, > > J > > > > On Nov 17 2011, Kay Cecil Cichini wrote: > > > > >..to be save I would consider to exclude an effect due to different > > >multivariate spread. See chapter 5.2, Homogeneity of groups and beta > > >diversity, in the vegan tutorial at > > >http://cc.oulu.fi/~jarioksa/opetus/metodi/vegantutor.pdf. > > > > > >best, > > >kay > > > > > > > > >Zitat von Gavin Simpson <[email protected]>: > > > > > >> On Wed, 2011-11-16 at 03:43 +0100, Gian Maria Niccolò Benucci wrote: > > >>> Hi all, > > >>> > > >>> I had 84 samples collected in 7 different sites. In each sample were > > >>> individuated the different fungal species and recorded. I would test if > > >>> exist a real difference between the sites and if exist a sort of site > > >>> effect that structure the fungal communities... Then, I did adonis test > > >>> > > >>> > adonis(community.sq ~ location, data=env.table, permutations=999) > > >>> > > >>> Call: adonis(formula = community.sq ~ location, data = env.table, > > >>> permutations = 999) > > >>> > > >>> Df SumsOfSqs MeanSqs F.Model R2 Pr(>F) > > >>> location 6 12.593 2.09886 6.8867 0.34922 0.001 *** > > >>> Residuals 77 23.467 0.30477 0.65078 > > >>> Total 83 36.060 1.00000 > > >>> --- > > >>> Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1 > > >>> > > >>> > > >>> > > >>> The significance is R2=0.349 at P=0.001 Can I assure that exist a > > >>> strong site effect in structuring the communities in each site? > > >> > > >> Depends. The test is one of no effect of `location`. You have found > > >> evidence against this hypothesis and thus could reject this hypothesis, > > >> instead accepting the alternative hypothesis that there is an effect of > > >> `location`. As to the strength of this effect? ~35% of the sums of > > >> squares can be explained by `location`. Substantially more of the > > >> variance remains unexplained. As I know nothing about your subject area, > > >> I am unable to comment further on the strength of the relationship. > > >> > > >> Seeing as many ecologists whose work I read would say an effect is > > >> significant if the p-value was >= 0.05. Not that I subscribe to this way > > >> or working, but by that criterion, you have identified a significant > > >> `location` effect. > > >> > > >> HTH > > >> > > >> G > > >> > > >>> > > >>> Thanks for helping, > > >>> > > >>> G. > > >>> > > >>> [[alternative HTML version deleted]] > > >>> > > >>> _______________________________________________ > > >>> R-sig-ecology mailing list > > >>> [email protected] > > >>> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology > > >> > > >> -- > > >> %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~% > > >> Dr. Gavin Simpson [t] +44 (0)20 7679 0522 > > >> ECRC, UCL Geography, [f] +44 (0)20 7679 0565 > > >> Pearson Building, [e] gavin.simpsonATNOSPAMucl.ac.uk > > >> Gower Street, London [w] http://www.ucl.ac.uk/~ucfagls/ > > >> UK. WC1E 6BT. [w] http://www.freshwaters.org.uk > > >> %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~% > > >> > > >> _______________________________________________ > > >> R-sig-ecology mailing list > > >> [email protected] > > >> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology > > >> > > >> > > > > > >_______________________________________________ > > >R-sig-ecology mailing list > > >[email protected] > > >https://stat.ethz.ch/mailman/listinfo/r-sig-ecology > > > > > > _______________________________________________ R-sig-ecology mailing list [email protected] https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
