0

I have two numeric vectors each shows the days we need to do different tasks: a using new technology versus in b using a old technology

a <- c(10, 59, 30, 5)

b<- c(19, 70, 50, 25)

I need to know is there a significant difference between a and b? and if yes estimate the Magnitude of Differences Between Two Groups?

2 Answers2

0

if your values are normally distributed, you can use R's inbuilt t.test function. If not you can use the wilcox.test function (no assumption about how the population is distributed).

The magnitude of difference you can probably just calculate as a fold change.

t.test(a,b)
wilcox.test(a,b)

foldChange = mean(a)/mean(b)
NicolasH2
  • 774
  • 5
  • 20
  • Thank you so much for your response, do you think Paired t test is appropriate in my example? – samira n Mar 18 '21 at 06:10
  • a paired t test would apply if the individual values from a and b are connected in some way, so e.g. the first value of a and b each come from the same specimen, the second value of a and b come from another specimen and so on – NicolasH2 Mar 18 '21 at 09:21
0

Assuming both of the sample groups a and b come from normal distributions, you can define and test if there is a significant difference in the means of both groups with a two sample t-test as follows.

Note, it would help to know if the variance of the two populations are equal or not, but this is also addressed in the t.test function's arguments:

t.test(a, b, alternative="two.sided", var.equal=FALSE, conf.level=0.95)

AlexG
  • 1
  • 1