 In this video I will explain a couple of basic statistical tests. We have addressed statistical testing before in the context of this example. So in 2005 there is a finding that among the largest 500 Finnish companies, the companies that were led by women's CEO were 4.7% points more profitable than the companies led by male CEOs. And the question that we want to answer is whether that kind of difference can be by chance only. So to assess whether chance provides a plausible explanation we need to understand a couple of different things. Most importantly how many women led companies there are, which is 22. And also how is the return on assets distributed. In this example we knew that the mean of return of assets was about 10. So could it be by chance only. We formally addressed that question, we did a null hypothesis significance test. And the idea of null hypothesis significance testing is that we first define a test statistic. And then we derive a sampling distribution for that test statistic under the null hypothesis that there is no difference. So when we actually did repeated samples of this population we found out that taking 22 companies comparing against the 478 remaining companies, the mean difference between these two companies follows a normal distribution. So sometimes we get mean ROA for the smaller sample that is more than 10 points larger than the larger sample and sometimes the opposite result. The probability of obtaining 4.7 point or greater difference to this direction is 0.04. So it's 4% probability. Normally we will be using a two-tell test where we also use this probability area here or this area here. And that will give us 8% probability. So it's close to the 5% threshold that we normally use for statistical significance. So how do we generalize this idea? So what's the logic behind this comparison? Well first of all this comparison why it's difficult to do is that we have to specify this distribution for each of our research studies or research problems separately because the scale of the dependent variable varies. So if we have ROA then the scale is somewhere between minus 10 to plus 10 for this statistic. If we have number of personnel then the scale for the statistic is in hundreds or thousands and if we have the revenues then it's in the millions or billions of euros scale. So this is not practical because we would have to define the distribution for each problem separately. So we want to use one standardized approach for every problem of this kind. And to do that we use the t-test. The idea of a t-test is that instead of looking at the raw statistic, the raw estimate, the 4.7 here we look at the estimate divided by its standard error. And that gives us a standardized metric that we can compare against the null distribution. So the estimate divided by its standard error is distributed as students t if it's a t-test. And the idea was that instead of looking at the raw estimate we standardized the estimates. So remember standardizing something is subtracting the mean first and then dividing by the standard deviation. So the mean here is the null hypothesis value so subtracting zero doesn't do anything. And then we divide by the standard error which is the estimate of the standard deviation of this estimate when we actually do the study over and over many times. So that's the logic. We standardize the estimates and then based on the standard error and then we compare against the t-distributions. Then if our sample size is large or we are using large sample statistics, then this same test goes by the name z-test. And the z-test statistic is defined exactly the same way as the t-statistic. The difference is that in z-test we compare against the standard normal distribution. So in large samples the students t-distribution approach is the standard normal distribution with mean of zero and standard deviation of one. So why what's the difference? Why do we need two tests? The reason why we need these two tests is that for some or most statistical tests we don't actually know how they behave in small samples and their behavior is known only in large samples. So if for example maximum likelihood estimates that we'll cover later, we know how they work in very large samples. In small samples their behavior is generally not known. So for that we rely on the assumption that our sample size is large enough and then we use the z-statistic. In regression analysis we know how the estimates are distributed even in small samples and therefore we can use the t-distributions. Whenever you see t or z well it just quantifies the estimate divided by its standard error and your statistical software will pick the proper distribution for you automatically. So you don't have to know anything else except that these are basically the same thing except that we compare against the different distributions. So that's a simple two test, t and z depending on whether you know the small sample distribution of the statistic if you don't then you use z-test and assume that the sample size is large enough for that to hold. So what if you have multiple statistics? Sometimes we want to test if two regression coefficients for example are different from zero at the same time. So we want to know that the null hypothesis is that both regression coefficients are exactly zero and if either one of those is non-zero then we reject the null. So in t and z tests we basically assess how far from the zero point the actual estimate is on a standardized metric. So we have a line and we go along that line and see how far we get. So when we have two statistics then we have a plane. So we have x, we have y here and we have x here. And then we have an estimate here, so we have an estimate of both regression coefficients one and two or y and x whatever. And we want to know how far again we are from the zero point. So high school math tells you that to get this distance you raise the distance on x-axis to second power, you raise the distance on y-axis to second power, you take a sum and then you take a square root of that sum. So that gives you the distance here, so basic geometry. In practice we do that except we don't take the square root because we just want to have some reference value and it doesn't matter whether we get this distance as a reference value or the square of this distance as a reference value. It's quicker if we don't take the square root. So what we actually do is that for this kind of multiple hypothesis testing is that we compare the sum of squared variables against the chi-square distribution. So the chi-square distribution is defined as the sum of squared normal variables. So if you have two variables we take squares of both and then we sum the squares and then that gives us a distribution which follows chi-square with decrease of freedom of two. So that has an obvious parallel to minimizing the sum of squared residences. So we quite often we take sums of squares in statistics. So how it works actually in the context of t-test and how this chi-square test can be seen as an extension of the z-test. Well, we just take the square of the estimate, take the square of the standard deviation or standard error in this case and that provides us something called a wall test and that can be applied to multiple hypothesis. So whenever you divide estimate divided by standard error then you are doing a z-test or a t-test. If you divide estimate squared divided by standard error squared then that's called a wall test. And the advantage of wall test is that it can be applied to these multiple or two dimensional or more dimensional problems. And the difference is chi-square distribution. So if you have two variables then the sum of squares of the estimates divided by the standard error squared will follow chi-square with two degrees of freedom. If you have three variables, the sum of squares divided by the standard errors will follow chi-square with three degrees of freedom. So that's the basics of chi-square testing. So you are basically assessing how far on a standardized metric the individual combination of two or more estimates are from the zero point using a standard error.