I am trying to conduct a paired t-test and generate a resulting p-value for some methylation data that I have.
The data is in 6 columns: 3 for each patient before treatment and 3 for each patient after treatment. There is one row for each gene (several thousand), and values range from [0,1].
I'd like to conduct a t-test for each row and ultimately generate one p-value for each gene. In this paired t-test, you'd have the value in [1,1], paired up with [1,4], [1,2] with [1,5], and [1,3] with [1,6].
I do not want to use the limma package since this is not strictly array data. Can you use limma for non-array data?
How would I go about conducting each t-test and generating the resulting p-values?
Below is what I am running right now, but R returns "Error in t.test.default(cg.t[i, c(1, 3, 5)], cg.t[i, c(2, 4, 6)]) : not enough 'x' observations"
pValue <- numeric(0)
for(i in seq(nrow(df)))
pValue <- c(pValue,
t.test(df[i,c(1,3,5)],
df[i,c(2,4,6)])$p.value)
Please excuse my naivety, as I am a just a novice biostatistician in my first year working with R. Your help is appreciated.