One sample t test for the mean - overview

This page offers structured overviews of one or more selected methods. Add additional methods for comparisons by clicking on the dropdown button in the right-hand column. To practice with a specific method click the button at the bottom row of the table

One sample $t$ test for the mean
Logistic regression
Independent variableIndependent variables
NoneOne or more quantitative of interval or ratio level and/or one or more categorical with independent groups, transformed into code variables
Dependent variableDependent variable
One quantitative of interval or ratio levelOne categorical with 2 independent groups
Null hypothesisNull hypothesis
$\mu = \mu_0$
$\mu$ is the unknown population mean; $\mu_0$ is the population mean according to the null hypothesis
Model chi-squared test for the complete regression model:
• $\beta_1 = \beta_2 = \ldots = \beta_K = 0$
Wald test for individual regression coefficient $\beta_k$:
• $\beta_k = 0$
or in terms of odds ratio:
• $e^{\beta_k} = 1$
Likelihood ratio chi-squared test for individual regression coefficient $\beta_k$:
• $\beta_k = 0$
or in terms of odds ratio:
• $e^{\beta_k} = 1$
in the regression equation $\ln \big(\frac{\pi_{y = 1}}{1 - \pi_{y = 1}} \big) = \beta_0 + \beta_1 \times x_1 + \beta_2 \times x_2 + \ldots + \beta_K \times x_K$
Alternative hypothesisAlternative hypothesis
Two sided: $\mu \neq \mu_0$
Right sided: $\mu > \mu_0$
Left sided: $\mu < \mu_0$
Model chi-squared test for the complete regression model:
• not all population regression coefficients are 0
Wald test for individual $\beta_k$:
• $\beta_k \neq 0$
or in terms of odds ratio:
• $e^{\beta_k} \neq 1$
If defined as Wald $= \dfrac{b_k}{SE_{b_k}}$ (see 'Test statistic'), also one sided alternatives can be tested:
• right sided: $\beta_k > 0$
• left sided: $\beta_k < 0$
Likelihood ratio chi-squared test for individual $\beta_k$:
• $\beta_k \neq 0$
or in terms of odds ratio:
• $e^{\beta_k} \neq 1$
AssumptionsAssumptions
• Scores are normally distributed in the population
• Sample is a simple random sample from the population. That is, observations are independent of one another
• In the population, the relationship between the independent variables and the log odds $\ln (\frac{\pi_{y=1}}{1 - \pi_{y=1}})$ is linear
• The residuals are independent of one another
• Variables are measured without error
Also pay attention to:
• Multicollinearity
• Outliers
Test statisticTest statistic
$t = \dfrac{\bar{y} - \mu_0}{s / \sqrt{N}}$
$\bar{y}$ is the sample mean, $\mu_0$ is the population mean according to H0, $s$ is the sample standard deviation, $N$ is the sample size.

The denominator $s / \sqrt{N}$ is the standard error of the sampling distribution of $\bar{y}$. The $t$ value indicates how many standard errors $\bar{y}$ is removed from $\mu_0$
Model chi-squared test for the complete regression model:
• $X^2 = D_{null} - D_K = \mbox{null deviance} - \mbox{model deviance}$
$D_{null}$, the null deviance, is conceptually similar to the total variance of the dependent variable in OLS regression analysis. $D_K$, the model deviance, is conceptually similar to the residual variance in OLS regression analysis.
Wald test for individual $\beta_k$:
The wald statistic can be defined in two ways:
• Wald $= \dfrac{b_k^2}{SE^2_{b_k}}$
• Wald $= \dfrac{b_k}{SE_{b_k}}$
SPSS uses the first definition

Likelihood ratio chi-squared test for individual $\beta_k$:
• $X^2 = D_{K-1} - D_K$
$D_{K-1}$ is the model deviance, where independent variable $k$ is excluded from the model. $D_{K}$ is the model deviance, where independent variable $k$ is included in the model.
Sampling distribution of $t$ if H0 were trueSampling distribution of $X^2$ and of the Wald statistic if H0 were true
$t$ distribution with $N - 1$ degrees of freedomSampling distribution of $X^2$, as computed in the model chi-squared test for the complete model:
• chi-squared distribution with $K$ (number of independent variables) degrees of freedom
Sampling distribution of the Wald statistic:
• If defined as Wald $= \dfrac{b_k^2}{SE^2_{b_k}}$: approximately a chi-squared distribution with 1 degree of freedom
• If defined as Wald $= \dfrac{b_k}{SE_{b_k}}$: approximately a standard normal distribution
Sampling distribution of $X^2$, as computed in the likelihood ratio chi-squared test for individual $\beta_k$:
• chi-squared distribution with 1 degree of freedom
Significant?Significant?
Two sided:
Right sided:
Left sided:
For the model chi-squared test for the complete regression model and likelihood ratio chi-squared test for individual $\beta_k$:
• Check if $X^2$ observed in sample is equal to or larger than critical value $X^{2*}$ or
• Find $p$ value corresponding to observed $X^2$ and check if it is equal to or smaller than $\alpha$
For the Wald test:
• If defined as Wald $= \dfrac{b_k^2}{SE^2_{b_k}}$: same procedure as for the chi-squared tests. Wald can be interpret as $X^2$
• If defined as Wald $= \dfrac{b_k}{SE_{b_k}}$: same procedure as for any $z$ test. Wald can be interpreted as $z$.
$C\%$ confidence interval for $\mu$Wald-type approximate $C\%$ confidence interval for $\beta_k$
$\bar{y} \pm t^* \times \dfrac{s}{\sqrt{N}}$
where the critical value $t^*$ is the value under the $t_{N-1}$ distribution with the area $C / 100$ between $-t^*$ and $t^*$ (e.g. $t^*$ = 2.086 for a 95% confidence interval when df = 20)

The confidence interval for $\mu$ can also be used as significance test.
$b_k \pm z^* \times SE_{b_k}$
where $z^*$ is the value under the normal curve with the area $C / 100$ between $-z^*$ and $z^*$ (e.g. $z^*$ = 1.96 for a 95% confidence interval)
Effect sizeGoodness of fit measure $R^2_L$
Cohen's $d$:
Standardized difference between the sample mean and $\mu_0$: $$d = \frac{\bar{y} - \mu_0}{s}$$ Indicates how many standard deviations $s$ the sample mean $\bar{y}$ is removed from $\mu_0$
$R^2_L = \dfrac{D_{null} - D_K}{D_{null}}$
There are several other goodness of fit measures in logistic regression. In logistic regression, there is no single agreed upon measure of goodness of fit.
Visual representationn.a.
-
Example contextExample context
Is the average mental health score of office workers different from $\mu_0$ = 50?Can body mass index, stress level, and gender predict whether people get diagnosed with diabetes?
SPSSSPSS
Analyze > Compare Means > One-Sample T Test...
• Put your variable in the box below Test Variable(s)
• Fill in the value for $\mu_0$ in the box next to Test Value
Analyze > Regression > Binary Logistic...
• Put your dependent variable in the box below Dependent and your independent (predictor) variables in the box below Covariate(s)
JamoviJamovi
T-Tests > One Sample T-Test
• Put your variable in the box below Dependent Variables
• Under Hypothesis, fill in the value for $\mu_0$ in the box next to Test Value, and select your alternative hypothesis
Regression > 2 Outcomes - Binomial
• Put your dependent variable in the box below Dependent Variable and your independent variables of interval/ratio level in the box below Covariates
• If you also have code (dummy) variables as independent variables, you can put these in the box below Covariates as well
• Instead of transforming your categorical independent variable(s) into code variables, you can also put the untransformed categorical independent variables in the box below Factors. Jamovi will then make the code variables for you 'behind the scenes'
Practice questionsPractice questions