# all code written in this script was based on R version 3.6.2 #This code works on a csv file containing non-transformed [delta][delta]Cq-values (Calculated by substracting the observed Cq value for the gene of interest by the geometric mean of the Cq values of the reference genes). The file should contain a variable named 'Rearing_density' encoding the density the animal was reared in. Remove all other data from your file before running the script. data <- read.csv("Your/Path/To/File/DeltaCqvalues.csv") #Before performing a student t test, we test whether the data are normally distributed with a shapiro test. P-values larger than 0.05 for both groups (Isolated and Crowded) suggest this is indeed the case. Exchange GOI by your gene of interest. with(data, shapiro.test(GOI[rearing_density == "Crowded"])) with(data, shapiro.test(GOI[rearing_density == "Isolated"])) # the following line will give you all information for the t-test including the p-value. Exchange 'GOI' for your particular Gene of Interest. t.test(GOI ~ rearing_density, data = data, var.equal = TRUE)