Analysis of Ant Food Preferences and Behavior: Biology Project

Verified

Added on  2022/11/26

|4
|1097
|371
Project
AI Summary
This project details an experiment designed to investigate the attractiveness of different food types to ants. The experiment compared honey (sugar), cheese (protein), and cooked rice (carbohydrate) as bait in three different locations. The student recorded latency (time to ant appearance), duration (time ants spent at the food), and the number of ants for each food type over a period of ten days. Control containers with water were used. Statistical analyses, including ANOVA and Tukey HSD post-hoc tests, were performed in R to determine significant differences in ant behavior across different food types and locations. The results provide insights into ant food preferences and the effectiveness of different food types in attracting ants. Power analysis was also conducted to determine the statistical power of the experiment. The report includes data, R code, and analysis results.
Document Page
R version 3.5.2 (2018-12-20) -- "Eggshell Igloo"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
[Workspace loaded from ~/.RData]
> #getting the mean of the variables by the food type
> aggregate(x=food_type$Latency, by=list(food_type$Food.type), FUN="mean")
Group.1 x
1 cheese 16.22500
2 cooked rice 31.20389
3 Honey 22.83722
> aggregate(food_type$duration, by=list(food_type$Food.type), FUN="mean")
Group.1 x
1 cheese 18.48167
2 cooked rice 15.68722
3 Honey 22.55833
> aggregate(food_type$number, by=list(food_type$Food.type), FUN="mean")
Group.1 x
1 cheese 13.70000
2 cooked rice 12.40000
3 Honey 16.06667
>
> #ploting the boxplot on the same figure
> par(mfcol=c(1,3))
> boxplot(food_type$number, col = "blue", xlab = "number")
> boxplot(food_type$Latency, col = "green",xlab="Latency")
> boxplot(food_type$duration, col = "yellow", xlab = "duration")
>
> qqnorm(food_type$Latency, col = "green",main = "QQ-plot Latency")
> qqline(food_type$Latency)
> qqnorm(food_type$duration, col = "red", main = "QQ-plot duration")
> qqline(food_type$duration)
> qqnorm(food_type$number, col = "purple",main = "QQ-plot number")
> qqline(food_type$number)
> par(mfcol=c(1,1)) #this was to remove chart partition
>
>
>
> mod=aov(number~Food.type,data = food_type)
> summary(mod)
Df Sum Sq Mean Sq F value Pr(>F)
Food.type 2 207 103.7 1.035 0.36
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Residuals 87 8717 100.2
> TukeyHSD(mod)
Tukey multiple comparisons of means
95% family-wise confidence level
Fit: aov(formula = number ~ Food.type, data = food_type)
$Food.type
diff lwr upr p adj
cooked rice-cheese -1.300000 -7.462842 4.862842 0.8700673
Honey-cheese 2.366667 -3.796175 8.529508 0.6318934
Honey-cooked rice 3.666667 -2.496175 9.829508 0.3357992
> #getting the power of the anova test
> numbergroupmean=c(13.70000,12.40000,16.06667)
> powernumber = power.anova.test(groups = length(numbergroupmean),
+ n=length(food_type$number),
+ between.var = var(numbergroupmean),
+ within.var = var(food_type$number))
> powernumber
Balanced one-way analysis of variance power calculation
groups = 3
n = 90
between.var = 3.455933
within.var = 100.2778
sig.level = 0.05
power = 0.5941541
NOTE: n is number in each group
>
> mod1=aov(Latency~Food.type, data = food_type)
> summary(mod1)
Df Sum Sq Mean Sq F value Pr(>F)
Food.type 2 3381 1690.4 9.764 0.000149 ***
Residuals 87 15062 173.1
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
> TukeyHSD(mod1) #this is a post Hoc analysis
Tukey multiple comparisons of means
95% family-wise confidence level
Fit: aov(formula = Latency ~ Food.type, data = food_type)
$Food.type
diff lwr upr p adj
cooked rice-cheese 14.978890 6.878000 23.0797791 0.0000871
Honey-cheese 6.612223 -1.488667 14.7131125 0.1319875
Honey-cooked rice -8.366667 -16.467556 -0.2657771 0.0413166
> latencygroupmean=c(16.22500,31.20389,22.83722)
> powerlatency = power.anova.test(groups = length(latencygroupmean),
+ n=length(food_type$Latency),
Document Page
+ between.var = var(latencygroupmean),
+ within.var = var(food_type$Latency))
> powerlatency
Balanced one-way analysis of variance power calculation
groups = 3
n = 90
between.var = 56.34829
within.var = 207.2259
sig.level = 0.05
power = 0.9999981
NOTE: n is number in each group
>
> mod2=aov(duration~Food.type, data = food_type)
> summary(mod2)
Df Sum Sq Mean Sq F value Pr(>F)
Food.type 2 716 358.2 2.516 0.0867 .
Residuals 87 12387 142.4
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
> TukeyHSD(mod2) #this is a post Hoc analysis
Tukey multiple comparisons of means
95% family-wise confidence level
Fit: aov(formula = duration ~ Food.type, data = food_type)
$Food.type
diff lwr upr p adj
cooked rice-cheese -2.794445 -10.1408115 4.551922 0.6373480
Honey-cheese 4.076666 -3.2697005 11.423033 0.3862277
Honey-cooked rice 6.871111 -0.4752557 14.217478 0.0717337
> durationgroupmean=c(18.48167,15.68722,22.55833)
> powerduration = power.anova.test(groups = length(durationgroupmean),
+ n=length(food_type$Latency),
+ between.var = var(durationgroupmean),
+ within.var = var(food_type$duration))
> powerduration
Balanced one-way analysis of variance power calculation
groups = 3
n = 90
between.var = 11.94004
within.var = 147.23
sig.level = 0.05
power = 0.9354174
NOTE: n is number in each group
>
> mod3=aov(number~Food.type+Location+Food.type*Location,data = food_type)
Document Page
> summary(mod3)
Df Sum Sq Mean Sq F value Pr(>F)
Food.type 2 207 104 7.264 0.00125 **
Location 2 7381 3691 258.583 < 2e-16 ***
Food.type:Location 4 180 45 3.150 0.01848 *
Residuals 81 1156 14
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
chevron_up_icon
1 out of 4
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]