## Running t-Tests in SAS

All three types of $$t$$-tests can be performed in SAS. This tutorial will demonstrate the steps and syntax needed to conduct one sample, two independent samples, and paired samples t-tests. There are two datafiles used in this tutorial. The iq_wide can be downloaded here, and the iq_long data can be downloaded here. The one-sample and independent samples examples will use the iq_long data, and the paired samples example will use iq_wide.

## One-Way Analysis of Variance (ANOVA)

ANOVA You should recall from our previous tutorials how to conduct a two sample t-test to compare two means. However, what do we do when we have more than two groups? ANOVA (Analysis of Variance) is how we can make these comparisons. The Logic of ANOVA The total variability we see in our dependent variables can have two sources. Within-groups variance: what is the variability of the dependent variable inside a particular group?

## The t-Distribution and Conducting t-Tests

The t-Distribution According to the central limit theorem, the distribution of means across repeated sampling (the sampling distribution) will be normal, centered on the true population mean, and have a standard error (the standard deviation of the sampling distribution) equal to ${\sigma_M}=\frac{\sigma}{\sqrt{n}}$ The numerator $$\sigma$$ is the standard deviation of values in the population, calculated as $\sigma = \sqrt{ \frac{ \sum (x_i-\mu)^2}{N}}$ We can convert the distribution of means to be unit normal by converting the means from each sample to $$z$$-scores.
t-Tests in R All three types of $$t$$-tests can be performed using the same t.test function in R. The primary arguments are the following: x and (optionally) y, or a formula, e.g. y ~ x. These specify the interval-level outcome variable y and the two-level factor variable x. The formula syntax can be used for the independent samples $$t$$-test. If a formula is specified, the data argument can be specified so that it is not necessary to specify the data frame using df$x and df$y notation.
t-Tests in SPSS SPSS allows you to conduct one-sample, independent samples, and paired samples $$t$$-tests. This page demonstrates how to perform each using SPSS. The data used in this tutorial can be downloaded from here. The one-sample and independent samples examples will use the iq_long.sav data, and the paired samples example will use iq_wide.sav. One Sample $$t$$-Test Say we have data from 200 subjects who have taken an IQ test. We know in the general population the mean IQ is 100.