I ran a two-way ANCOVA on the data below, in r-studio, to determine whether pupal weights Pupal.wt
were affected by caterpillars' diet Trt
, initial weights Initial.wt
, and the amount of time it took each caterpillar to reach pupation Larval.period
: aov(Pupal.wt ~ Trt*Initial.wt*Larval.period, data = GM).
Is a Tukey HSD test sufficient to follow this analysis?
If so, how can I change either the code or my data to make TukeyHSD()
work (I get this error message when I try to run it:
> ANCOVA <-aov(Pupal.wt ~ Trt*Initial.wt*Larval.period, data = GMdata=GM)
> TukeyHSD(ANCOVA)
Error in rep.int(n, length(means)) : unimplemented type 'NULL' in 'rep3'
In addition: Warning messages: 1: In replications(paste("~", xx), data = mf) :
non-factors ignored: Initial.wt 2: In replications(paste("~", xx), data = mf) :
non-factors ignored: Larval.period 3: In replications(paste("~", xx), data = mf) :
non-factors ignored: Trt, Initial.wt 4: In replications(paste("~", xx), data = mf) :
non-factors ignored: Trt, Larval.period 5: In replications(paste("~", xx), data = mf) :
non-factors ignored: Initial.wt, Larval.period 6: In replications(paste("~", xx), data = mfdata=mf) :
non-factors ignored: Trt, Initial.wt, Larval.period
Here'sHere are my data:
> str(GM)
'data.frame': 44 obs. of 5 variables:
$ Trt : Factor w/ 2 levels "Infested","Uninfested": 2 2 2 2 2 2 2 2 2 2 ...
$$ Trt : Factor w/ 2 levels "Infested","Uninfested": 2 2 2 2 2 2 2 2 2 2 ...
$ Larval.period : int 14 20 18 18 26 14 22 26 20 18 ...
$ Initial.wt : num 0.181 0.318 0.218 0.195 0.25 0.181 0.213 0.255 0.236 0.298 ...
$$ Initial.wt : num 0.181 0.318 0.218 0.195 0.25 0.181 0.213 0.255 0.236 0.298 ...
$ Pupal.wt : num 0.294 0.519 0.527 0.326 0.511 0.299 0.584 0.442 0.481 0.452 ...
$ X..weight.gain: num 62.4 63.2 141.7 67.2 104.4 ...