Re: [R] Design matrix for species mixture

2017-05-12 Thread Bert Gunter
Please take this thread elsewhere(e.g. Stats.stackexchange.com) as it is largely about statistics and is therefore offtopic here (this list is about R programming). Cheers, Bert On May 12, 2017 1:21 AM, "Margot Neyret" wrote: Hi Jim, Sorry if my question was not clear. I will try to explain a

Re: [R] Design matrix for species mixture

2017-05-12 Thread Jim Lemon
Hi Margot, Very messy, like nature. One way is to do tests with dummy variables that compare: beans+anything vs anything without beans maize+anything vs anything without maize pumpkin+anything vs anything without pumpkin Then if you find that the "beans" comparison has the strongest effect, perha

Re: [R] Design matrix for species mixture

2017-05-12 Thread Margot Neyret
Hi Jim, Sorry if my question was not clear. I will try to explain again… I have one response variable Y, let’s say vegetation cover. Then I have my explanatory variable, let’s call it Crop. In my field I can have either Maize (m), Bean (b), Pumpkin (p) or mixtures : m+b, m+p, b+p, m+b+p. I also

Re: [R] Design matrix for species mixture

2017-05-11 Thread Jim Lemon
Hi Margot, I'm not sure I understand your model, but if I make up some data in which the response variable is vegetation cover and the three species are: A - eats one type of plant B - eats another type of plant C - preys on herbivorous insects df<-read.table(text="field,propveg,A,B,C 1,1,0,0,1

[R] Design matrix for species mixture

2017-05-11 Thread Margot Neyret
Hello, I have fields with species mixtures (for instance, species a, b, c, a+b, a+c, b+c), and I look at the effect of each species on a response Y. More specifically, I would like to compare the effect of individual species, either alone or in mixture. >Y = rnorm(18,0,1) >mixture= rep(c('a','