[R] LSD value

David L Carlson dcarlson at tamu.edu
Mon Jan 18 20:00:45 CET 2016


Providing us with a reproducible example, makes it much easier to answer your question. The object returned by LSD.test() is completely different from the object described in the "Value" section of its manual page which makes things confusing. If you look at the first example on the manual page:

> library(agricolae)
> data(sweetpotato)
> model<-aov(yield~virus, data=sweetpotato)
> out <- LSD.test(model,"virus", p.adj="bonferroni")
> out
$statistics
    Mean      CV  MSerror     LSD
  27.625 17.1666 22.48917 13.4704

$parameters
  Df ntr bonferroni alpha       test name.t
   8   4   3.478879  0.05 bonferroni  virus

$means
      yield      std r       LCL      UCL  Min  Max
cc 24.40000 3.609709 3 18.086268 30.71373 21.7 28.5
fc 12.86667 2.159475 3  6.552935 19.18040 10.6 14.9
ff 36.33333 7.333030 3 30.019601 42.64707 28.0 41.8
oo 36.90000 4.300000 3 30.586268 43.21373 32.1 40.4

$comparison
NULL

$groups
  trt    means  M
1  oo 36.90000  a
2  ff 36.33333  a
3  cc 24.40000 ab
4  fc 12.86667  b

So you can get the LSD statistic with

> out$statistics$LSD
[1] 13.4704
> out$statistics[4]
      LSD
  13.4704
> out[[1]][4]
      LSD
  13.4704

-------------------------------------
David L Carlson
Department of Anthropology
Texas A&M University
College Station, TX 77840-4352


-----Original Message-----
From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of Jianling Fan
Sent: Monday, January 18, 2016 10:47 AM
To: r-help
Subject: [R] LSD value

Hello, everyone,

I am using LSD.test() from package "agricolae" to do my anova
analysis. I know I can calculate LSD value by its equation
t*sqrt(MSE*2/n), but I am wondering if there is a code or something
that can give the LSD value more directly in R?

Thanks!

Julian

______________________________________________
R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list