```
library(car)
#> Loading required package: carData
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following object is masked from 'package:car':
#>
#> recode
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
library(ggplot2)
#> Registered S3 methods overwritten by 'ggplot2':
#> method from
#> [.quosures rlang
#> c.quosures rlang
#> print.quosures rlang
dataset <- iris %>%
select(Sepal.Length, Species) %>%
filter(Species != "virginica") %>%
mutate(Species = droplevels(x = Species))
leveneTest(y = (Sepal.Length ~ Species),
data = dataset) # reject null hypothesis of homoscedasticity
#> Levene's Test for Homogeneity of Variance (center = median)
#> Df F value Pr(>F)
#> group 1 8.1727 0.005196 **
#> 98
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
t.test(formula = (Sepal.Length ~ Species),
data = dataset,
var.equal = FALSE) # not assuming homoscedasticity
#>
#> Welch Two Sample t-test
#>
#> data: Sepal.Length by Species
#> t = -10.521, df = 86.538, p-value < 2.2e-16
#> alternative hypothesis: true difference in means is not equal to 0
#> 95 percent confidence interval:
#> -1.1057074 -0.7542926
#> sample estimates:
#> mean in group setosa mean in group versicolor
#> 5.006 5.936
ggplot(data = dataset %>%
group_by(Species) %>%
summarise(cnt = length(Sepal.Length),
avg = mean(Sepal.Length),
std_dev = sd(Sepal.Length),
lwr_bd = (avg - (qnorm(p = 0.975) * std_dev / sqrt(x = cnt))),
upr_bd = (avg + (qnorm(p = 0.975) * std_dev / sqrt(x = cnt)))),
mapping = aes(x = Species)) +
geom_point(aes(y = avg)) +
geom_errorbar(mapping = aes(ymin = lwr_bd,
ymax = upr_bd)) +
labs(y = "Sepal Length",
title = "95% Confidence Interval")
```

```
ggplot(data = dataset) +
geom_boxplot(mapping = aes(x = Species,
y = Sepal.Length)) +
labs(y = "Sepal Length",
title = "Box Plot")
```

^{Created on 2019-06-16 by the reprex package (v0.3.0)}

Hope this helps.