2
$\begingroup$

So, I have two variables (matched pairs) that I believe are means, with a collection of 10 samples a piece (although if I'm reading it right, they're the same 10 individuals undergoing different trials). It looks a bit like this:

Situation 1: 125, 156, 140, 175, 153, 148, 180, 135, 168, 157
Situation 2: 120, 145, 142, 150, 160, 148, 160, 142, 162, 150

Now the problem is asking for a t test statistic and a p-value, the test statistic is $\frac{\bar x_d}{s_d/\sqrt{n_d}}$, where:

  • $\bar x_d$ should be the difference between all of the means summed, so Avg(situation1) - Avg(situation2), which comes out to 5.8.

  • $s_d$ is the standard deviation (that's all my textbook is giving me).

And $n_d$ is just 10.

Any help would be appreciated, my past two attempts at this problem have been complete bummers - the standard deviation I started trying was 17.512 because that's just what my technology spits out when I put all the values in.

$\endgroup$
3
  • 1
    $\begingroup$ Please add the self-study tag & read its wiki. $\endgroup$ Commented Dec 2, 2020 at 19:16
  • 1
    $\begingroup$ Your task is to transform this apparent two-sample case to a one-sample case, by substracting each value from situation 1 to situation 2 (or the reverse, it doesn't really matter for numerical computation). Let's call this new sample "d". Then, think about how to compute $\bar x_d$ and $s_d$ from "d". $\endgroup$
    – chl
    Commented Dec 2, 2020 at 19:16
  • $\begingroup$ Oh, ok! So, instead of two different stdevs, it's the stdev of the set of values that I get from subtracting the values in situation 2 from situation 1, making 𝑠 10.654 and x 5.8. Super duper helpful, thank you! $\endgroup$
    – Candy H
    Commented Dec 2, 2020 at 19:31

1 Answer 1

1
$\begingroup$

@chi has given a verbal description. Here is how it looks in the R t.test procedure.

x1 =  c(125, 156, 140, 175, 153, 148, 180, 135, 168, 157)
x2 =  c(120, 145, 142, 150, 160, 148, 160, 142, 162, 150)
d = x1-x2

summary(d); length(d); sd(d)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
   -7.0    -1.5     5.5     5.8    10.0    25.0 
[1] 10        # number of differences
[1] 10.65416  # standard deviation of 10 differences

stripchart(d, meth="stack", pch=20)

enter image description here

Notice that the t statistic for the t tests below is as follows:

(mean(d) - 0)/(sd(d)/sqrt(10))
[1] 1.721507

First, doing a one-sample test on the differences d to test the null hypothesis that the population mean of the paired differences is $0.$ The sample mean of the differences is greater $\bar D = 5.8 > 0,$ but compared with the standard deviation $S_d = 10.65$ we cannot say that $\bar D$ is significantly larger than $0.$ The P-value exceeds $0.05 = 5\%,$ so the null hypothesis is not rejected. [The population difference might be anywhere between $-1.822$ and $13.422.]$

t.test(d)

        One Sample t-test

data:  d
t = 1.7215, df = 9, p-value = 0.1193
alternative hypothesis: 
  true mean is not equal to 0
95 percent confidence interval:
 -1.821526 13.421526
sample estimates:
mean of x 
      5.8 

Second, if you use the parameter pair=T for t.test, then the program find the differences and does the same thing as above; the t-statistic, degrees of freedom, and P-value are all the same as before.

t.test(x1, x2, pair=T)

        Paired t-test

data:  x1 and x2
t = 1.7215, df = 9, p-value = 0.1193
alternative hypothesis: 
 true difference in means is not equal to 0
95 percent confidence interval:
  -1.821526 13.421526
sample estimates:
mean of the differences 
                   5.8 

Notes: (1) In both cases the null hypothesis is that the population of pairs has mean $0$ and the alternative hypothesis is two-sided. (Additional parameters in t.test are required if you want to change either.) (2) Because each pair is for a different individual it is reasonable to assume that there is a positive correlation between x1 and x2. [Because x1 and x2 are not independent samples, it would be incorrect to do a two-sample t.test.]

cor(x1,x2)
[1] 0.799743

Also, t tests are exact only if the data (differences here) are from a normal population. With only $n=10$ differences it is difficult to assess normality of the differences. However, there is no evidence of strong skewness in the stripchart, and there are no extreme outliers. Moreover, a Shapiro-Wilk test shows that differences are consistent with a normal sample.

shapiro.test(d)

        Shapiro-Wilk normality test

data:  d
W = 0.93627, p-value = 0.5123
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.