Assuming that you have to calculate the test statistic for the difference between the population means, μ₁, μ₂. To calculate the statistic you have to subtract the population parameter from the point estimate and divide it by the standard deviation.
The population parameter is (μ₁ - μ₂)
The point estimator is (x-bar₁ - x-bar₂)
The standard deviation is [(S₁/√n₁) +(S₂/√n₂)]
Let's say, for example, that the test is two-tailed, then:
The test statistic can be calculated as:
n₁= 50
x-bar₁= 2.31
S₁= 0.89
n₂=30
x-bar₂= 2.02
S₂= 0.61
For the difference between the population means you have to use the value under the null hypothesis, in this case, μ₁ - μ₂ = 0
The value of the statistic is 1.22