I want to test if the means of two groups of measurements are equal or not. I perform the analysis using R software and, in particular, the function t.test()
. Even though the means of the two groups are different (the mean of group A is -0.04570781 and the mean of group B is 0.03339135) , the p-value is higher than the significance threshold 0.05 (it's 0.213). Why does it happen ? The group A has 95 measurements, while the group B only 10. Is it due to the different sample size of the two groups of measurements ? Or maybe the difference between the values of the two means is too low to be detected ?
The output results of my test is
Welch Two Sample t-test
data: x and y
t = -1.3223, df = 10.98, p-value = 0.213
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-0.21079297 0.05259464
sample estimates:
mean of x mean of y
-0.04570781 0.03339135
Moreover my code is:
x <- RadVsNotRadiation[RadVsNotRadiation$Condition=='Irradiated',"mRNA"]
y <- RadVsNotRadiation[RadVsNotRadiation$Condition=='reference',"mRNA"]
t.test(x,y)
and the data that I have used are:
> dput(RadVsNotRadiation)
structure(list(Gene = c("ID-1", "ID-1", "ID-1", "ID-1", "ID-1",
"ID-1", "ID-1", "ID-1", "ID-1", "ID-1", "ID-1", "ID-1", "ID-1",
"ID-1", "ID-1", "ID-1", "ID-1", "ID-1", "ID-1", "ID-4", "ID-4",
"ID-4", "ID-4", "ID-4", "ID-4", "ID-4", "ID-4", "ID-4", "ID-4",
"ID-4", "ID-4", "ID-4", "ID-4", "ID-4", "ID-4", "ID-4", "ID-4",
"ID-4", "ID-5", "ID-5", "ID-5", "ID-5", "ID-5", "ID-5", "ID-5",
"ID-5", "ID-5", "ID-5", "ID-5", "ID-5", "ID-5", "ID-5", "ID-5",
"ID-5", "ID-5", "ID-5", "ID-5", "ID-6", "ID-6", "ID-6", "ID-6",
"ID-6", "ID-6", "ID-6", "ID-6", "ID-6", "ID-6", "ID-6", "ID-6",
"ID-6", "ID-6", "ID-6", "ID-6", "ID-6", "ID-6", "ID-6", "ID-7",
"ID-7", "ID-7", "ID-7", "ID-7", "ID-7", "ID-7", "ID-7", "ID-7",
"ID-7", "ID-7", "ID-7", "ID-7", "ID-7", "ID-7", "ID-7", "ID-7",
"ID-7", "ID-7", "ID-1", "ID-1", "ID-4", "ID-4", "ID-5", "ID-5",
"ID-6", "ID-6", "ID-7", "ID-7"), mRNA = c(-0.181385669, -0.059647494,
0.104476117, NA, NA, NA, -0.052190978, -0.040484945, 0.194226742,
-0.501601326, 0.102342605, -0.127143845, -0.008523742, -0.102946211,
-0.042894028, 0.002922923, -0.134394347, -0.214204393, NA, -0.138122686,
0.203242361, 0.097935502, NA, NA, NA, 0.147068146, -0.089430917,
0.331565412, -0.034572422, -0.129896329, 0.324191, 0.470108479,
-0.027268223, 0.232304713, 0.090348708, 0.070848402, 0.181540708,
-0.502255367, -0.267631441, -0.368647839, -0.040910404, -0.003983171,
-0.003983171, -0.003983171, -0.14980589, -0.119449612, -0.309154214,
-0.487589361, 0.272803506, -0.421733575, NA, -0.467108567, 0.024868338,
-0.156025729, -0.044680175, -0.206716896, -0.272014193, -0.230499883,
-0.238597397, -0.118130949, 0.349957464, 0.349957464, 0.349957464,
0.172048587, -0.186226994, 0.16113822, -0.293029136, -0.111636253,
-0.044189887, 0.081555274, -0.048106079, -0.05853566, 0.010407814,
-0.066981809, -0.09828484, NA, -0.315190986, -0.005102456, 0.221556197,
0.206584568, 0.206584568, 0.206584568, 0.102649006, NA, -0.011777384,
-0.36963487, -0.054853074, -0.230240699, -0.210508323, -0.208889919,
-0.050763372, 0.023073782, -0.095118984, -0.091076071, -0.330257395,
0.102772933, 0.247872038, 0.216357646, 0.126169901, -0.237278842,
-0.066908278, 0.105082639, NA, -0.050061512, -0.143484352), Condition = structure(c(1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), .Label = c("Irradiated", "reference"
), class = "factor")), row.names = c(NA, -105L), class = "data.frame")
Any suggestion will be appreciated. Thank you in advance.