First, let’s plot the data

bwplot(Pair~Percentage, data=fish)

densityplot(~Percentage, groups = Pair, auto.key = TRUE, data=fish)

We might be wondering whether the length matters, or whether there is a lot of variation between the different male pairs. Let’s plot the data:

plot(fish$Length, fish$Percentage)

It certainly doesn’t look like there is a linear trend there.

Let’s go back to the boxplot

bwplot(Pair~Percentage, data=fish)

Do the variances look equal here? It looks like there is an outlier.

Let’s look at some diagnostic plots

fit <- lm(Percentage~Pair, data=fish)
plot(fit, 1)

plot(fit, 2)

There are definitely outliers there – maybe it’s love!

summary(lm(Percentage~Pair, data=fish))
## 
## Call:
## lm(formula = Percentage ~ Pair, data = fish)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -52.429  -8.414   0.247  10.859  28.871 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   56.406      3.864  14.597   <2e-16 ***
## PairPair2      4.479      5.657   0.792   0.4308    
## PairPair3      6.023      5.384   1.119   0.2667    
## PairPair4     10.594      5.657   1.873   0.0649 .  
## PairPair5      7.805      6.441   1.212   0.2292    
## PairPair6      6.929      5.657   1.225   0.2243    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 15.46 on 78 degrees of freedom
## Multiple R-squared:  0.04796,    Adjusted R-squared:  -0.01307 
## F-statistic: 0.7858 on 5 and 78 DF,  p-value: 0.563

The F-test doesn’t say that the pairs are different.

So what about the yellow swordtails?

Let’s check for normality one last time, and run the test

hist(fish$Percentage)

t.test(mean(Percentage ~ Pair, mu=50, data = fish))
## 
##  One Sample t-test
## 
## data:  mean(Percentage ~ Pair, mu = 50, data = fish)
## t = 42.864, df = 5, p-value = 1.304e-07
## alternative hypothesis: true mean is not equal to 0
## 95 percent confidence interval:
##  58.63722 66.11885
## sample estimates:
## mean of x 
##  62.37803