waltax
1
Hi

This is my first post here, i'm ab it of a newbie on R.

I am running an two way anova based on this script : [https://rstatisticsandresearch.weebly.com/two-way-anova.html](link to script1)

I have had quite some help finding my errors in other topic around here but now that i approach the end of the script there appears a final error.

```
> cld(posthoc,
+ alpha=.05,
+ Letters=letters)
Error in cld(posthoc, alpha = 0.05, Letters = letters) :
could not find function "cld"
```

I guess cld must be in some library ???

if you are going through the script **R script part 1 - twowayanova.r**

you will see it loads package lsmeans directly before using cld function

waltax
3
I updated lsmeans and run this part of the script again. Now i stil get the error.

this is what appears in the console:

```
library("lsmeans")
> library("multcompView")
>
> posthoc <- lsmeans(model1,
+ pairwise ~ object*tijd,
+ adjust="tukey")
> posthoc
$lsmeans
object tijd lsmean SE df lower.CL upper.CL
0 w1 7.42 0.501 552 5.87 8.96
2 w1 7.38 0.501 552 5.83 8.92
5 w1 7.42 0.501 552 5.87 8.96
...
Confidence level used: 0.95
Conf-level adjustment: sidak method for 24 estimates
$contrasts
contrast estimate SE df t.ratio p.value
0,w1 - 2,w1 0.0417 0.708 552 0.059 1.0000
0,w1 - 5,w1 0.0000 0.708 552 0.000 1.0000
0,w1 - 10,w1 0.1667 0.708 552 0.235 1.0000
...
[ reached getOption("max.print") -- omitted 110 rows ]
P value adjustment: tukey method for comparing a family of 24 estimates
>
> cld(posthoc,
+ alpha=.05,
+ Letters=letters)
Error in cld(posthoc, alpha = 0.05, Letters = letters) :
could not find function "cld"
```

i guess i can manually check all of the contrasts but i'd rather have a clear graph or table printed . any other way to fix this ?

seems that cld is really a function of multcomp package, perhaps lsmeans just provides methods for it.

try to load the multcomp library

system
Closed
5
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.