The denominator is an estimate of the standard error of the difference between the two unknown population means. The formula above extends this idea to two groups that use a pooled estimate for s standard deviation , and that can have different group sizes. We then compare the test statistic to a t value with our chosen alpha value and the degrees of freedom for our data.
The degrees of freedom df are based on the group sizes and are calculated as:. There are two possible results from our comparison:. When the variances for the two groups are not equal, we cannot use the pooled estimate of standard deviation.
Instead, we take the standard error for each group separately. The test statistic is:. The numerator of the test statistic is the same. It is the difference between the averages of the two groups. The denominator is an estimate of the overall standard error of the difference between means.
It is based on the separate standard error for each group. The degrees of freedom calculation for the t value is more complex with unequal variances than equal variances and is usually left up to statistical software packages. The key point to remember is that if you cannot use the pooled estimate of standard deviation, then you cannot use the simple formula for the degrees of freedom. The normality assumption is more important when the two groups have small sample sizes than for larger sample sizes.
Normal distributions do not have extreme values, or outliers. You can check these two features of a normal distribution with graphs. The figure below shows a normal quantile plot for men and women, and supports our decision. You can also perform a formal test for normality using software. The figure above shows results of testing for normality with JMP software.
We test each group separately. Both the test for men and the test for women show that we cannot reject the hypothesis of a normal distribution.
We can go ahead with the assumption that the body fat data for men and for women are normally distributed. Testing for unequal variances is complex. The figure below shows results of a test for unequal variances for the body fat data. Without diving into details of the different types of tests for unequal variances, we will use the F test. Like most statistical software, JMP shows the p -value for a test. This is the likelihood of finding a more extreme value for the test statistic than the one observed.
For the figure above, with the F test statistic of 1. We fail to reject the hypothesis of equal variances. In practical terms, we can go ahead with the two-sample t -test with the assumption of equal variances for the two groups.
Using a visual, you can check to see if your test statistic is a more extreme value in the distribution. The figure below shows a t- distribution with 21 degrees of freedom. Because our test statistic of 2. The figure below shows results for the two-sample t -test for the body fat data from JMP software. The results for the two-sample t -test that assumes equal variances are the same as our calculations earlier.
The test statistic is 2. The software shows results for a two-sided test and for one-sided tests. Our null hypothesis is that the mean body fat for men and women is equal.
Our alternative hypothesis is that the mean body fat is not equal. The one-sided tests are for one-sided alternative hypotheses — for example, for a null hypothesis that mean body fat for men is less than that for women. We can reject the hypothesis of equal mean body fat for the two groups and conclude that we have evidence body fat differs in the population between men and women.
The software shows a p -value of 0. It is important to make this decision before doing the statistical test. The figure also shows the results for the t- test that does not assume equal variances.
This test does not use the pooled estimate of the standard deviation. As was mentioned above, this test also has a complex formula for degrees of freedom. You can see that the degrees of freedom are The software shows a p- value of 0. If you have more than two independent groups, you cannot use the two-sample t- test. You should use a multiple comparison method. ANOVA, or analysis of variance, is one such method. If your sample size is very small, it might be hard to test for normality.
In this situation, you might need to use your understanding of the measurements. For example, for the body fat data, the trainer knows that the underlying distribution of body fat is normally distributed. Even for a very small sample, the trainer would likely go ahead with the t -test and assume normality. What if you know the underlying measurements are not normally distributed? Or what if your sample size is large and the test for normality is rejected?
In this situation, you can use nonparametric analyses. These types of analyses do not depend on an assumption that the data values are from a specific distribution. This is called the proportional odds assumption or the parallel regression assumption. Because the relationship between all pairs of groups is the same, there is only one set of coefficients only one model.
If this was not the case, we would need different models such as a generalized ordered logit model to describe the relationship between each pair of outcome groups. A factorial logistic regression is used when you have two or more categorical independent variables but a dichotomous dependent variable. For example, using the hsb2 data file we will use female as our dependent variable, because it is the only dichotomous variable in our data set; certainly not because it common practice to use gender as an outcome variable.
We will use type of program prog and school type schtyp as our predictor variables. Because prog is a categorical variable it has three levels , we need to create dummy codes for it.
SPSS will do this for you by making dummy codes for all variables listed after the keyword with. SPSS will also create the interaction term; simply list the two variables that will make up the interaction separated by the keyword by.
Furthermore, none of the coefficients are statistically significant either. This shows that the overall effect of prog is not significant. A correlation is useful when you want to see the relationship between two or more normally distributed interval variables.
For example, using the hsb2 data file we can run a correlation between two continuous variables, read and write. In the second example, we will run a correlation between a dichotomous variable, female , and a continuous variable, write. Although it is assumed that the variables are interval and normally distributed, we can include dummy variables when performing correlations. In the first example above, we see that the correlation between read and write is 0.
By squaring the correlation and then multiplying by , you can determine what percentage of the variability is shared. In the output for the second example, we can see the correlation between write and female is 0. Squaring this number yields. Simple linear regression allows us to look at the linear relationship between one normally distributed interval predictor and one normally distributed interval outcome variable. For example, using the hsb2 data file , say we wish to look at the relationship between writing scores write and reading scores read ; in other words, predicting write from read.
We see that the relationship between write and read is positive. Hence, we would say there is a statistically significant positive linear relationship between reading and writing. A Spearman correlation is used when one or both of the variables are not assumed to be normally distributed and interval but are assumed to be ordinal. The values of the variables are converted in ranks and then correlated.
In our example, we will look for a relationship between read and write. We will not assume that both of these variables are normal and interval. Logistic regression assumes that the outcome variable is binary i. We have only one variable in the hsb2 data file that is coded 0 and 1, and that is female. We understand that female is a silly outcome variable it would make more sense to use it as a predictor variable , but we can use female as the outcome variable to illustrate how the code for this command is structured and how to interpret the output.
The first variable listed after the logistic command is the outcome or dependent variable, and all of the rest of the variables are predictor or independent variables. In our example, female will be the outcome variable, and read will be the predictor variable.
As with OLS regression, the predictor variables must be either dichotomous or continuous; they cannot be categorical. The results indicate that reading score read is not a statistically significant predictor of gender i. Likewise, the test of the overall model is not statistically significant, LR chi-squared — 0.
Multiple regression is very similar to simple regression, except that in multiple regression you have more than one predictor variable in the equation. For example, using the hsb2 data file we will predict writing score from gender female , reading, math, science and social studies socst scores.
Furthermore, all of the predictor variables are statistically significant except for read. Analysis of covariance is like ANOVA, except in addition to the categorical predictors you also have continuous predictors as well. For example, the one way ANOVA example used write as the dependent variable and prog as the independent variable. Multiple logistic regression is like simple logistic regression, except that there are two or more predictors.
The predictors can be interval variables or dummy variables, but cannot be categorical variables. If you have categorical predictors, they should be coded into one or more dummy variables. We have only one variable in our data set that is coded 0 and 1, and that is female. The first variable listed after the logistic regression command is the outcome or dependent variable, and all of the rest of the variables are predictor or independent variables listed after the keyword with.
In our example, female will be the outcome variable, and read and write will be the predictor variables. These results show that both read and write are significant predictors of female. Discriminant analysis is used when you have one or more normally distributed interval independent variables and a categorical dependent variable. It is a multivariate technique that considers the latent dimensions in the independent variables for predicting group membership in the categorical dependent variable.
For example, using the hsb2 data file , say we wish to use read , write and math scores to predict the type of program a student belongs to prog. Clearly, the SPSS output for this procedure is quite lengthy, and it is beyond the scope of this page to explain all of it. However, the main point is that two canonical variables are identified by the analysis, the first of which seems to be more related to program type than the second.
For example, using the hsb2 data file , say we wish to examine the differences in read , write and math broken down by program type prog. The students in the different programs differ in their joint distribution of read , write and math.
Multivariate multiple regression is used when you have two or more dependent variables that are to be predicted from two or more independent variables.
In our example using the hsb2 data file , we will predict write and read from female , math , science and social studies socst scores. These results show that all of the variables in the model have a statistically significant relationship with the joint distribution of write and read. Canonical correlation is a multivariate technique used to examine the relationship between two groups of variables. For each set of variables, it creates latent variables and looks at the relationships among the latent variables.
It assumes that all variables in the model are interval and normally distributed. SPSS requires that each of the two groups of variables be separated by the keyword with. There need not be an equal number of variables in the two groups before and after the with. The output above shows the linear combinations corresponding to the first canonical correlation. At the bottom of the output are the two canonical correlations.
These results indicate that the first canonical correlation is. The F-test in this output tests the hypothesis that the first canonical correlation is equal to zero. It is often used in hypothesis testing to determine whether a process or treatment actually has an effect on the population of interest, or whether two groups are different from one another. You want to know whether the mean petal length of iris flowers differs according to their species.
You find two different species of irises growing in a garden and measure 25 petals of each species. You can test the difference between these two groups using a t-test. Table of contents When to use a t-test What type of t-test should I use? Performing a t-test Interpreting test results Presenting the results of a t-test Frequently asked questions about t-tests. A t-test can only be used when comparing the means of two groups a. If you want to compare more than two groups, or if you want to do multiple pairwise comparisons, use an ANOVA test or a post-hoc test.
The t-test is a parametric test of difference, meaning that it makes the same assumptions about your data as other parametric tests. The t-test assumes your data:. If your data do not fit these assumptions, you can try a nonparametric alternative to the t-test, such as the Wilcoxon Signed-Rank test for data with unequal variances. When choosing a t-test, you will need to consider two things: whether the groups being compared come from a single population or two different populations, and whether you want to test the difference in a specific direction.
Scribbr editors not only correct grammar and spelling mistakes, but also strengthen your writing by making sure your paper is free of vague language, redundant words and awkward phrasing.
See editing example. The t-test estimates the true difference between two group means using the ratio of the difference in group means over the pooled standard error of both groups. You can calculate it manually using a formula, or use statistical analysis software. In this formula, t is the t-value, x 1 and x 2 are the means of the two groups being compared, s 2 is the pooled standard error of the two groups, and n 1 and n 2 are the number of observations in each of the groups.
A larger t -value shows that the difference between group means is greater than the pooled standard error, indicating a more significant difference between the groups. You can compare your calculated t -value against the values in a critical value chart to determine whether your t -value is greater than what would be expected by chance.
If so, you can reject the null hypothesis and conclude that the two groups are in fact different. This built-in function will take your raw data and calculate the t -value.
It will then compare it to the critical value, and calculate a p -value. This way you can quickly see whether your groups are statistically different. In your comparison of flower petal lengths, you decide to perform your t-test using R.
0コメント