Skip to content

ShaneSeheult/QMEE

Repository files navigation

QMEE

This REPO is part of the requirements for BIOLOGY 708

This is the paragraph describing the dataset to be used for Assignment 01 in BIOLOGY 708.

In eastern temperate North America, big brown bats (Eptesicus fuscus) generally give birth to twin pups. The bats mate in the later summer and the fall. Females store sperm during the winter and when they emerge from hibernation in the early spring they ovulate and give birth about two months later. The purpose of this study was to assess and look for differences in the birth dates of pups born to females from two captive populations. One population were caught at a maternity colony in southern Ontario, Canada about three weeks before parturition. The second population of pups were born to females that been in captivity for an extended period of time during hibernation and prior to parturition. I will assess if pups from newly-captive wild-caught females have similar birth dates (Julian Date) compared to pups born to females that had been living in captivity for a longer period of time. I will also compare these populations to see if they differ in the proportion of same-sex siblings (i.e. male-male or female-female siblings) and different-sex siblings (i.e. male-female).

This paragraph isto describe two (2) scripts - Assignment02a.R and Assignment02b.R - which are located in my repository /QMEE/data.

Assignment02a.R: This script uploads my data (Teat_Preferenace_QMEE_Project.csv) and essentially cleans the data. First, the script examines the dataframe (dd) in a readable manner (changes chr to fct), and looks for any problems in dd (see problems() function). Since the original data file inputted a column for pup sex twice (oops!), I removed the second occurrence of sex data, reducing the redundancy of dd. The script then correctly formats dd: (1) it changes values in the birthday columns into (see ymd() function), (2) it changes column names to make them easier to call/read, and (3) it changes to for applicable variables - making summary tables more informative. The script then saves the cleaned version of dd as an .rds file, which can then be called/accessed in Assignment02b.R

Assignment02b.R: This script loads the cleaned dataset from Assignment02a.R (dd). Assignment02a.R performs calculations and visualizes the data in dd - looking for any abnormalities in the data and evaluating hypotheses. First, the script creates subsets of the dataframe based on the categorical variable "Group" and conducts a t-test to evaluate if birthdays (indexed by Julian Dates) differ between pups born from captive and wild-caught moms: The results suggest a significant difference between birthdays of pups born to captive and wild-caught mothers (t(26.92) = 3.37, p = 0.002, 95%CI [0.70, 2.90]). Figure 01 (fig01) shows the distribution of Julian Date birthdays between groups (captive and wild-caught) displayed as box plots - it is evident that their are no outliers/anomalies present in the data. To test if the data is normal, the script runs a linear model (see lm() function) and generates a QQ plot on the residuals of the linear model. Since the data points fall (closely) on the diagonal reference line, the data can be interpreted as normal. The script also runs a Shapiro-Wilk test on the residuals of the linear model to accompany this plot: The results suggest the data is normal (W = 0.967, p = 0.105). Figure 02 (fig02) showcases the distribution of the data as a histogram. The script also tests the hypotheses of whether pup twins tend to be the same sex (either Male-Male or Female-Female) or different sex (Female-Male). The results of a 2 sample test for equality of proportions (see prop.test() function) suggest that there is a higher proportion of different sex siblings compared to same sex siblings (X^2 = 9.68, df = 1, p = 0.002, 95% CI[-0.487, -0.113]). The proportion of Same-Sibling pups is 0.32 and the the proportion of Different-Sex pups is 0.62.

About

This REPO is part of the requirements for BIOLOGY 708

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published