0

I am very new to R, and after reading several search results still couldn't figure out how to test different hypothesis from linear models in R. I have 3 replicates each from 3 plots (treatments). I want to test the hypothesis P2 > (P1+P3)/2 with rep as a blocking factor (rcbd) and without rep as blocking factor (crd).

I think the lhe linear models can be fit by rcbd lm(resp ~ factor(plot) + factor(rep), data=pheno) crd lm(resp ~ factor(plot), data=pheno)

How do I test the hypothesis P2 > (P1+P3)/2 (P stands for plot) ?

pheno

rep plot resp
R1 P1 12.6
R2 P1 11.9
R3 P1 12.3
R1 P2 13.0
R2 P2 12.4
R3 P2 12.4
R1 P3 11.3
R2 P3 11.9
R3 P3 10.9

1 Answers1

1

You can use glht from the multcomp package.

We have a page about it: http://www.ats.ucla.edu/stat/r/faq/testing_contrasts.htm

Neal Fultz
  • 9,282
  • 1
  • 39
  • 60