# Beginner question with running a t-test

Just for future reference, when you post a question here, is better if you do it in the form of a REPRoducible EXample (reprex), to exemplify, in your case your question should look similar to this (not an answer).

``````# Sample data on a copy/paste friendly format
df <- data.frame(
Before = c(18L, 18L, 21L, 18L, 18L, 20L, 23L, 23L, 21L, 17L, 18L, 24L,
20L, 18L, 24L, 22L, 15L, 19L),
After = c(24L, 25L, 33L, 29L, 33L, 36L, 34L, 36L, 34L, 27L, 29L, 29L,
24L, 26L, 38L, 27L, 22L, 31L),
Group = as.factor(c("T", "T", "T", "T", "T", "T", "T", "T", "T", "T",
"C", "C", "C", "C", "C", "C", "C", "C"))
)
# Code relevant to the issue
t.test(Before ~ Group, data = df)
#>
#>  Welch Two Sample t-test
#>
#> data:  Before by Group
#> t = 0.22743, df = 12.116, p-value = 0.8239
#> alternative hypothesis: true difference in means is not equal to 0
#> 95 percent confidence interval:
#>  -2.571012  3.171012
#> sample estimates:
#> mean in group C mean in group T
#>            20.0            19.7
t.test(After ~ Group, data = df)
#>
#>  Welch Two Sample t-test
#>
#> data:  After by Group
#> t = -1.2744, df = 14.482, p-value = 0.2226
#> alternative hypothesis: true difference in means is not equal to 0
#> 95 percent confidence interval:
#>  -7.631457  1.931457
#> sample estimates:
#> mean in group C mean in group T
#>           28.25           31.10
``````

Created on 2019-03-17 by the reprex package (v0.2.1)