-1

I am trying to do a friedman test in the agricolae package. I tried this:

>with(data,friedman(seeds,trial,site, group=TRUE))

and get this error:

>Error in Summary.factor(c(1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,  : 
 min not meaningful for factors
In addition: There were 39 warnings (use warnings() to see them)
> warnings()
Warning messages:
1: In mean.default(x, na.rm = TRUE) :
argument is not numeric or logical: returning NA
2: In mean.default(x, na.rm = TRUE) :
argument is not numeric or logical: returning NA
...

This is what my data looks like:

>str(data)
'data.frame':   41 obs. of  6 variables:
$ ID       : int  20 34 41 48 62 69 76 97 104 146 ...
$ site     : Factor w/ 3 levels "Benton N","Benton S",..: 1 1 1 1 2 2 2 2 2 2 
$ plot     : int  3 5 6 7 1 2 3 6 7 13 ...
$ trial    : Factor w/ 2 levels "planting7","preplanting7": 1 1 1 1 1 1 1 1 1 1 
$ treatment: Factor w/ 2 levels "control","seed": 1 1 1 1 1 1 1 1 1 1 ...
$ seeds    : num  27.9 29.3 29.4 29 28.6 ...

I don't know how to make it work. Seeds should be numeric already. Site and plot aren't, but why would they need to be?

thanks

jrieb
  • 1

1 Answers1

0

I suppose you mixed up your arguments. A better try based on your data description would be:

    with(data, friedman(trial, site, seeds, group=TRUE))

But still, how would you want to get a complete block design with two factors having 2 and 3 levels and 41 observations?

See help: "friedman.test can be used for analyzing unreplicated complete block designs (i.e., there is exactly one observation in y for each combination of levels of groups and blocks) ..."

Andri Signorell
  • 1,279
  • 12
  • 23
  • Maybe this isn't the right test to run then? I have 3 sites where seeds were counted twice (hence "trial"). I ran an lme model, but it's not normal. Someone suggested that I run a non parametric test, specifically friedman. – jrieb Mar 03 '15 at 19:24