Re: [R-sig-eco] plyr and mvabund, conceptual issue

2014-10-29 Thread Maas, Kendra
ok, thanks. So properly written out, I want to split each block out of the dataset and run mvabund, manyglm, and anova on each subset, pulling coefficients out of the manyglm object and p values out of the anova. I can split the species matrix and env matrix by hand within the commands, so for

Re: [R-sig-eco] species richness, GLM and negative values

2014-10-29 Thread Bob O'Hara
On 10/29/2014 04:27 PM, Ludovico Frate wrote: > Dear all,I'am trying to fit a very simple linear model. I am analyzing the > differences in the number of species (DS) found in several permanent plots in > two year of observations. > Firstly, I have calculated the differences per plot (i.e. numb

Re: [R-sig-eco] species richness, GLM and negative values

2014-10-29 Thread Martin Weiser
Ludovico Frate píše v St 29. 10. 2014 v 16:27 +0100: > Dear all,I'am trying to fit a very simple linear model. I am analyzing the > differences in the number of species (DS) found in several permanent plots in > two year of observations. > Firstly, I have calculated the differences per plot (i.e

Re: [R-sig-eco] plyr and mvabund, conceptual issue

2014-10-29 Thread Krzysztof Sakrejda
Since you asked, this is a minimally reproducible example: install.packages('plyr') install.packages('mvabund') library(mvabund) library(plyr) data(Tasmania) tas.abund <- data.frame(Tasmania$abund) tas.env <- data.frame(Tasmania$treatment, Tasmania$block) mva.out <- dlply(tas.abund, ~tas.env$bloc

Re: [R-sig-eco] plyr and mvabund, conceptual issue

2014-10-29 Thread Maas, Kendra
I tried to replicate my problem with the data that is supplied with the mvabund package. How is that not a minimally reproducible example? Because I stop after the first step? From: Hadley Wickham [h.wick...@gmail.com] Sent: Wednesday, October 29, 201

[R-sig-eco] species richness, GLM and negative values

2014-10-29 Thread Ludovico Frate
Dear all,I'am trying to fit a very simple linear model. I am analyzing the differences in the number of species (DS) found in several permanent plots in two year of observations. Firstly, I have calculated the differences per plot (i.e. number of species in Plot 1 in Time A - number of species

[R-sig-eco] draw 95% confidence limits for non significant regression lines

2014-10-29 Thread Paolo Piras
Dear list, I write for a surely trivial doubt about plotting 95% CI of regression lines. I saw that someone draw them even for non significant regression lines. I think that this is not correct as , in the majority of cases, Ho is that beta is not significantly different from 0 and consequently

Re: [R-sig-eco] plyr and mvabund, conceptual issue

2014-10-29 Thread Hadley Wickham
It's really hard to help with out a minimal reproducible example, but normally a dlply call would look more like this: mva.out <- dlply(Tasmania, "block", function(df) { mvabund(block ~ treatment, data = df) }) Hadley On Tue, Oct 28, 2014 at 6:31 PM, Maas, Kendra wrote: > I'm trying to run mv

Re: [R-sig-eco] plyr and mvabund, conceptual issue

2014-10-29 Thread Hadley Wickham
On Wed, Oct 29, 2014 at 4:23 AM, Eduard Szöcs wrote: > Hai Kendra, > > i've used a simple for-loop to do this in the past. > > Something along these lines: > > > ###- > mymv <- function(response, env, zone) { > df <- data.frame(env

Re: [R-sig-eco] plyr and mvabund, conceptual issue

2014-10-29 Thread Eduard Szöcs
Forgotten to mention, that mymv() returns a list with two components (the model and the anova). You can then extract the information you need from this list, maybe like this: ###--- per_zone <- mymv(response, env, zone) # p-values from univariate GLMs s

Re: [R-sig-eco] plyr and mvabund, conceptual issue

2014-10-29 Thread Eduard Szöcs
Hai Kendra, i've used a simple for-loop to do this in the past. Something along these lines: ###- mymv <- function(response, env, zone) { df <- data.frame(env = env, zone = zone) out <- NULL for (i in levels(zone)) { rsp