Statistics - A Full Lecture to learn Data Science (2025 Version)

DATAtab www.youtube.com

Brief Summary

Namaste everyone! This video is a comprehensive guide to statistics, covering everything from basic concepts to advanced statistical tests. It explains descriptive vs. inferential statistics, levels of measurement, hypothesis testing (t-tests, ANOVA), correlation and regression analysis, and cluster analysis. It also addresses parametric vs. non-parametric tests and how to check assumptions like normality and equal variances.

  • Descriptive vs. Inferential Statistics
  • Hypothesis Testing (t-test, ANOVA, non-parametric tests)
  • Correlation and Regression Analysis
  • Cluster Analysis
  • Checking Assumptions (Normality, Equal Variances)

Intro

The video is an updated version of a popular statistics course. It aims to guide viewers through fundamental statistical concepts and powerful tests used in research. The course covers descriptive statistics, hypothesis testing, correlation, regression, and cluster analysis. All topics are also available in book format, link in description.

Basics of Statistics

Statistics involves collecting, analysing, and presenting data. Variables are key, like gender and newspaper preference in a survey. Data can come from surveys or experiments, such as drug trials. The goal is to either describe the sample data (descriptive statistics) or make inferences about the entire population (inferential statistics).

Descriptive statistics summarise data using measures of central tendency (mean, median, mode), dispersion (variance, standard deviation, range, IQR), frequency tables, and charts. Inferential statistics draw conclusions about a population based on a sample. This involves hypothesis testing, P-values, and statistical significance.

Level of Measurement

Levels of measurement are nominal, ordinal, interval, and ratio. Nominal data (e.g., gender, types of animals) can be categorised but not ranked. Ordinal data (e.g., rankings, satisfaction ratings) can be categorised and ranked, but intervals aren't meaningful. Metric data (interval and ratio) have equal intervals, allowing for meaningful differences and sums. The level of measurement determines which statistical analyses and visualisations are appropriate.

t-Test

A t-test analyses if there's a significant difference between the means of two groups. There are one-sample, independent samples, and paired samples t-tests. The one-sample t-test compares a sample mean to a known reference mean. The independent samples t-test compares the means of two independent groups. The paired samples t-test compares the means of two dependent groups (e.g., before and after measurements on the same subjects). T-tests require metric data that is normally distributed.

ANOVA (Analysis of Variance)

ANOVA tests whether there are statistically significant differences between the means of three or more groups. It's an extension of the t-test. The null hypothesis is that the means of all groups are equal. ANOVA uses the ratio of variance between groups to variance within groups to calculate an F-value. A post-hoc test identifies which specific groups differ significantly.

Two-Way ANOVA

Two-way ANOVA tests the effect of two categorical variables (factors) on a continuous variable. It can determine if each factor has a main effect and if there's an interaction effect between the factors. Assumptions include normality, homogeneity of variances, and independence of measurements.

Repeated Measures ANOVA

Repeated measures ANOVA tests whether there's a statistically significant difference between three or more dependent samples, where the same participants are measured multiple times. Assumptions include normality and sphericity (equal variances of the differences between all combinations of factor levels).

Mixed-Model ANOVA

Mixed-model ANOVA is used when there are both between-subject factors (different subjects in different groups) and within-subject factors (same subjects measured multiple times). It tests for main effects of each factor and interaction effects.

Parametric and non parametric tests

Parametric tests (e.g., t-test, ANOVA) assume data is normally distributed. Non-parametric tests (e.g., Mann-Whitney U test, Spearman's correlation) are used when data isn't normally distributed. Parametric tests are generally more powerful, but non-parametric tests make fewer assumptions.

Test for normality

Normality can be tested analytically (Kolmogorov-Smirnov, Shapiro-Wilk, Anderson-Darling tests) or graphically (histogram, QQ plot). Analytical tests provide a P-value; a P-value less than 0.05 suggests non-normality. Graphical methods, especially QQ plots, are increasingly preferred due to the sample size limitations of analytical tests.

Levene's test for equality of variances

Levene's test tests the hypothesis that the variances are equal in different groups. It's often used to check assumptions for other hypothesis tests, like t-tests and ANOVA. If the P-value is greater than 0.05, the null hypothesis (equal variances) is not rejected.

Mann-Whitney U-Test

The Mann-Whitney U test is a non-parametric test that checks whether there is a difference between two independent samples. It tests whether there is a rank sum difference.

Wilcoxon signed-rank test

The Wilcoxon signed-rank test analyses whether there's a difference between two dependent samples. It's the non-parametric counterpart to the paired samples t-test. It compares ranks rather than means.

Kruskal-Wallis-Test

The Kruskal-Wallis test is a hypothesis test that is used when you want to test whether there is a difference between several independent groups. It is the non-parametric counterpart of the single factor analysis of variance.

Friedman Test

The Friedman test analyzes whether there are statistically significant differences between three or more dependent samples. It is the nonparametric counter part of the analysis of variance with repeated measures.

Chi-Square test

The chi-square test is a hypothesis test that is used when you want to determine if there is a relationship between two categorical variables.

Correlation Analysis

Correlation analysis measures the relationship between two variables. The strength and direction of the correlation are indicated by the correlation coefficient (between -1 and 1). Positive correlation means high values of one variable go with high values of the other. Negative correlation means high values of one variable go with low values of the other. Common correlation coefficients are Pearson, Spearman, Kendall's Tau, and Point Biserial.

Regression Analysis

Regression analysis models relationships between variables to infer or predict a variable based on others. Simple linear regression uses one independent variable. Multiple linear regression uses several independent variables. Logistic regression is used when the dependent variable is categorical. Key assumptions include linearity, independence of errors, homoscedasticity, normally distributed errors, and no multicollinearity.

k-means clustering

K-means cluster analysis groups data into K clusters. The process involves defining the number of clusters, setting cluster centers randomly, assigning each element to the nearest cluster, calculating the center of each cluster, and repeating until the cluster solution doesn't change. The elbow method is used to determine the optimal number of clusters.

Confidence interval

Confidence intervals provide a range that is expected to capture the true population parameter with a certain level of confidence. A 95% confidence interval means that if you were to take an extremely large number of random samples and construct a confidence interval for each sample 95% of those intervals would contain the True Value while 5% would not.

Summarize any YouTube video in seconds

Get summaries like this one for any video, in your language, with the free Summ app.

Download on the Apple Store
Get it on Google Play

Transcript

Full transcript of “Statistics - A Full Lecture to learn Data Science (2025 Version)”. Click a timestamp to open the video at that moment. Need another video? Use the YouTube transcript generator.

0:00 hi everyone Welcome to our full and free tutorial about statistics before we dive in we want to say a huge thank you last year we launched our first ever full course on statistics and the response was absolutely amazing we are on track to reach 1 million views within just one year wow this inspired us to create a revised version for 2025 it was a big project but there it is thank you for being such an amazing community so let's start this video is designed to guide you through the fundamental concepts and most powerful statistical tests used in research today from the basics of descriptive

0:47 statistics to the complexities of regression and Beyond we'll explore how each method fits into the bigger picture of data analysis and don't worry if you have no no clue about statistics will go through everything step by step if you like you can find all topics in our book as well the link is in the video description so what is the outline of the video our video has three major parts in the first part we discuss what statistics is and what the differences between descriptive and inferential statistics are in the second part we go through the most common hypothesis test like T Test and an NOA and discuss the

1:33 difference between parametric and non-parametric tests in the third part we take a look at correlation analysis and regression analysis and finally we talk about clust analysis we have prepared detailed videos for each section so let's start with the video that explains what statistics is after this video you will know what statistics is what descriptive statistics is and what inferential statistics is so let's start with the first question what is statistics statistics deals with the collection analysis and presentation of data an example we would like to investigate whether gender has an

2:18 influence on the preferred newspaper then gender and newspaper are our so-called variables that we want to analyze in order to analyze whether gender has an influence on the preferred newspaper we first need to collect data to do this we create a questionnaire that asks about gender and preferred newspaper we will then send out the survey and wait 2 weeks afterwards we can display the received answers in a table in this table we have one column for each variable one for gender and one for newspaper on the other hand each row is the response of one served person the first respondent is mail and stated New

3:06 York Post the second is female and stated USA Today and so on and so forth of course the data does not have to be from a survey the data can also come from an experiment in which you for example want to study the effect of Two drugs on blood pressure now the first step is done we have collected data and we can start analyzing the data but what do we actually want to analyze we did not survey the entire population but we took a sample now the big question is do we just want to describe the sample data or do we want to make a statement about the whole population if our aim is limited to the sample itself I.E we only want to describe the collected data we

3:52 will use descriptive statistics descriptive statistics will provide a detailed summary of the sample however if we want to draw conclusions about the population as a whole inferential statistics are used this approach allows us to make educated guesses about the population based on the sample data let us take a closer look at both methods starting with descriptive statistics why is descriptive statistics so important let's say a company wants to know how its employees travel to work so the company creates a survey to answer this question once enough data has been collected this data can be analyzed using descriptive statistics but what is

4:38 descriptive statistics descriptive statistics aims to describe and summarize a data set in a meaningful way but it is important to note that descriptive statistics only describe the collected data without drawing conclusions about a larger population put simply just because we know how some people from one company get to work we cannot say how all working people of the company get to work this is the task of inferential statistics which we will discuss later to describe data descriptively we now look at the four key components measures of central tendency measures of dispersion frequency tables and charts let's start with the first one measures of central

5:24 tendency measures of central tendency are for example the mean the median and the mode Let's first have a look at the mean the arithmetic mean is the sum of all observations divided by the number of observations an example imagine we have the test scores of five students to find the mean score we sum up all the scores and divide by the number of scores the mean test score of these five students is therefore 86.6 what about the median when the values in a data set are are arranged in ascending order the median is the middle value if there is an odd number of data points the median is simply the middle

6:09 value if there is an even number of data points the median is the average of the two middle values it is important to note that the median is resistant to extreme values or outliers let's look at this example no matter how tall the last person is the person in the middle Remains the person in the middle so the median does not change but if we look at the mean it does have an effect on how tall the last person is the mean is therefore not robust to outliers let's continue with the mode the mode refers to the value or values that appear most frequently in a set of data for example if 14 people travel to work by car six

6:56 by bike five walk and five take public transport then car occurs most often and is therefore the mode great let's continue with the measures of dispersion measures of dispersion describe how spread out the values in a data set are measures of dispersion are for example the variance and standard deviation the range and the interquartile range let's start with the standard deviation the standard deviation indicates the average distance between each data point and the mean but what does that mean each person has some deviation from the mean now we want to know how much the person's deviate from the mean value on average

7:43 in this example the average deviation from the mean value is 11.5 cm to calculate the standard deviation we can use this equation Sigma is the standard deviation n is the number of persons it x i is the size of each person and xbar is the mean value of all persons but attention there are two slightly different equations for the standard deviation the difference is that we have once 1 / n and once's 1 / nus1 to keep it simple if our servy doesn't cover the whole population we always use this equation to estimate the standard deviation likewise if we have

8:30 conducted a clinical study then we also use this equation to estimate the standard deviation but what is the difference between the standard deviation and the variance as we now know the standard deviation is the quadratic mean of the distance from the mean the variance now is the squared standard deviation if you want to know more details about the standard deviation and the variance please watch our video let's move on to range and interquartile range it is easy to understand the range is simply the difference between the maximum and minimum value inter quartile range represents the middle 50% of the data it is the difference between the first quartile q1 and the third quartile Q3

9:18 therefore 25% of the values are smaller than the inter quartile range and 25% of the values are larger the inter quartal range contains exactly the middle 50% of the values before we get to the last two points let's briefly compare measures of central tendency and measures of dispersion let's say we measured the blood pressure of patients measures of central tendency provide a single value that represents the entire data set helping to identify a central value around which data points tend to Cluster measures of dispersion like the standard Devi the range and the inter quarle range indicate how spread out the data points

10:05 are whether they are closely packed around the center or spread far from it in summary while measures of central tendency provide a central point of the data set measures of dispersion describe how the data is spread around the center let's move on to tables here we will have a look at the most important ones frequency tables and contingency tables a frequency table displays how often each distinct value appears in a data set let's have a closer look at the example from the beginning a company surveyed its employees to find out how they get to work the options given were car bicycle walk and public transport here are the results from 30 employees

10:52 the first answer car the next walk and so on and so forth now we can create a fre table to summarize this data to do this we simply enter the four possible options car bicycle walk and public transport in the First Column and then count how often they occurred from the table it is evident that the most common mode of Transport among the employees is by car with 14 employees preferring it the frequency table thus provides a clear and concise summary of the data but what if we have not only one but two categorical variables this is where the contingency table also called cross tab comes in Imagine the company doesn't

11:39 have one Factory but two one in Detroit and one in Cleveland so we also ask the employees at which location they work if we want to display both variables we can use a contingency table a contingency table provides a way to analyze and compare the relationship between two categorical variables the rows of a contingency table represent the categories of one variable while the columns represent the categories of another variable each cell in the table shows the number of observations that fall into the corresponding category combination for example the first cell shows that car and Detroit were answered six times and what about the charts

12:26 let's take a look at the most important one to do this let's simply use data.net if you like you can load this sample data set with the link in the video description or you just copy your own data into this table here below you can see the variables distance to work mode of transport and site data daab gives you a hint about the level of measurement but you can also change it here now if we only click on mode of Transport we get a frequency table and we can also display the percentage values if we scroll down we get a bar chart and a pie chart here on the left we can adjust further settings for example we can specify whether we want

13:13 to display the frequences or the percentage values or whether the bars should be vertical or horizontal if you also select site we get a cross table here and a grouped bar chart for for the diagrams here we can specify whether we want the chart to be grouped or stacked if we click on distance to work and mode of Transport we get a bar chart where the height of the bar shows the mean value of the individual groups here we can also display the dispersion we also get a histogram a box plot a violin plot and a rainbow plot if you would like to know more about what a

13:58 Bo Bo plot a violin plot and a rainbow plot are take a look at my videos let's continue with inferential statistics at the beginning we briefly go through what inferential statistics is and then I'll explain the six key components to you so what is inferential statistics inferential statistics allows us to make a conclusion or inference about a population based on data from a sample what is the population and what is the sample the population is the whole group we're interested in if you want to study the average height of all adults in the United States then the population would be all adults in the United States the sample is a smaller group we actually

14:45 study chosen from the population for example 150 adults were selected from the United States and now we want to use the sample to make a statement about the population and here are the six steps how to do that number one hypothesis first we need a statement a hypothesis that we want to test for example you want to know whether a drug will have a positive effect on blood pressure in people with high blood pressure but what's next in our hypothesis we stated that we would like to study people with high blood pressure so our population is all people with high blood pressure in for example the US obious obviously we cannot collect data from the whole

15:31 population so we take a sample from the population now we use this sample to make a statement about the population but how do we do that for this we need a hypothesis test hypothesis testing is a method for testing a claim about a parameter in a population using data measured in a sample great that's exactly what we need there are many different hypothesis tests and at the end of this video I will give you a guide on how to find the right test and of course you can find videos about many more hypothesis tests on our Channel but how does a hypothesis test work when we conduct a hypothesis test we start with a research hypothesis also called alternative hypothesis this is the

16:18 hypothesis we are trying to find evidence for in our case the research hypothesis is the drug has an effect on blood pressure but we cannot test this hypothesis directly with a classical hypothesis test so we test the opposite hypothesis that the drug has no effect on blood pressure but what does that mean first we assume that the drug has no effect in the population we therefore assume that in general people who take the drug and people who don't take the drug have the same blood pressure on average if we now take a random sample and it turns out that the drug has a large effect in a sample then we can ask How likely it is to draw such a sample

17:05 or one that deviates even more if the drug actually has no effect so in reality on average there is no difference in the population if this probability is very low we can ask ourselves maybe the drug has an effect in the population and we may have enough evidence to reject the Nile hypothesis that the drug has no effect and it is this probability that is called the P value let's summarize this in three simple steps number one the null hypothesis states that there is no difference in the population number two the hypothesis test calculates how much the sample deviates from the null hypothesis number three the P value

17:51 indicates the probability of getting a sample that deviates as much as our sample or one that even deviates more than our sample assuming the null hypothesis is true but at what point is the P value small enough for us to reject the Nile hypothesis this brings us to the next Point statistical significance if the P value is less than a predetermined threshold the result is considered statistically significant this means that the result is unlikely to have occurred by chance alone and that we have enough evidence to re dect anal hypothesis this threshold is often 0.05 therefore a small P value suggests

18:36 that the observed data or sample is inconsistent with the null hypothesis this leads us to reject the null hypothesis in favor of the alternative hypothesis a large P value suggests that the observed data is consistent with the null hypothesis and we will not reject it but note there is always a risk of making an error a small P value does not prove that the alternative hypothesis is true it is only saying that it is unlikely to get such result or a more extreme when the Nal hypothesis is true and again if the Nal hypothesis is true there is no difference in the population and the other way around a large P value does not prove that the Nal hypothesis

19:22 is true it is only saying that it is likely to get such a result or a more extreme when the null hypothesis is true so there are two types of Errors which are called type one and type two error let's start with the type one error in hypothesis testing a type one error occurs when a true null hypothesis is rejected so in reality the null hypothesis is true but we make the decision to reject the null hypothesis in our example it means that the drug actually had no effect so in reality there there is no difference in blood pressure whether the drug is taken or not the blood pressure Remains the Same in both cases but our sample happened to

20:08 be so far off the True Value that we mistakenly thought the drag was working and a type two error occurs when a false null hypothesis is not rejected so in reality the null hypothesis is false but we make the decision not to reject an Al hypothesis in our example this means the drug actually did work there is a difference between those who have taken the drug and those who have not but it was just a coincidence that the sample taken did not show much difference and we mistakenly thought the drug was not working and now I'll show you how data helps you to find a suitable hypothesis test and of course calculates it and

20:54 interprets the results for you let's go to data.net and copy your own data in here we will just use this example data set after copying your data into the table the variables appear down here data tab automatically tries to determine the correct level of measurement but you can also change it up here now we just click on hypothesis testing and select the varibles we want to use for the calculation of a hypothesis test data tab will then suggest a suitable test for example in this case a Ki Square test or in that case an analysis of variance then you will see the hypothesis and the results if you're not

21:43 sure how to interpret the results click on summary inverts further you can check the assumptions and decide whether you want to calculate a parametric or a nonparametric test now we know the differences between descriptive and inferential statistics our next step is to take a closer look at inferential statistics and a choosing the appropriate hypothesis test which hypothesis test you can use depends on the level of measurement of your data there are four types of levels of measurement nominal ordinal interval and ratio and here is an easy explanation for you in this video we we are going to

22:29 explore the four levels of measurement nominal ordinal interval and ratio each level gives us important information about the variable and supports different types of statistical analysis by the end of this video you will know what the levels of measurement are and especially you will understand why you need these levels so whether you are analyzing survey data optimizing business operations or studying for a statistics Exam stay tuned what are levels of measurement levels of measurement refer to different ways that variables can be Quantified or categorized if you have a data set then every variable in the data set corresponds to one of the four

23:16 primary levels of measurement these levels are nominal ordinal interval and Rao in practice interval and ratio data are often used to perform the same analysis therefore the term matric level is used to combine these two levels why do you need levels of measurement the level of measurement is crucial in statistics for several key reasons it tells us how our data can be collected analyzed and interpreted here's why understanding these levels is so important different levels of measurement support different statistical analysis for instance mean and standard deviation are suitable for

24:02 matric data in some cases it may be suitable for ordinal data but only if you know how to interpret the results correctly and it definitely makes no sense to calculated for nominal data the level of measurement also tells us which hypothesis tests are possible and determines the most effective type of data visualization for example bar charts are great for nominal data while histograms are better suited for metric data so each level provides different information and supports various types of statistical analysis but attention the level of measurement is mainly relevant at the end of the research process however the types of data to be

24:49 collected and are formed are determined at the beginning therefore it is crucial to consider the level of measurement of the data from the start part to ensure that the desired tests can be conducted at the end so let's take a closer look at each level of measurement what characterizes nominal variables this is the most basic level of measurement nominal data can be categorized but it is not possible to rank the categories in a meaningful way examples of nominal variables are gender with the categories male and female types of animals with for example the categories dog cat bird or preferred newspaper in all these

25:36 cases you can tell whether one value corresponds to the other so you can distinguish the values but it is not possible to put the categories in a meaningful order an example we would like to investigate whether chender has an influence on the preferred newspaper both variables are nominal so when we create a questionnaire we simply list the possible answers for both variables since there is no meaningful order pH nominal variables it usually does not matter in which order the categories are listed in the questionnaire then we can display the collected data in a table where each row is a person with the respective answer we can now use our

26:23 data to create frequency tables or bar charts but what about the ordinal level of measurement ordinal data can be categorized and in comparison with ninal data it is possible to have a meaningful ranking of the categories but differences between ranks do not have a mathematical meaning this means the intervals between the data points are not necessarily equal examples of ordinant variables are all kinds of rankings like first second third satisfaction ratings very unsatisfied unsatisfied neutral satisfied very satisfied and levels of Education High School Bachelors Masters in a

27:11 questionnaire you could ask how satisfied are you with your current job in this case we have these five possible options the answers can be categorized and there is a logic order that's why the variable satisfaction with the job is an ordinal variable what about matric variables matric variables are the highest level of measurement matric data is like ordinal but the intervals between values are equally spaced this means the differences and sums can be formed meaningfully examples of mic variables are Income weight age and electricity consumption if you ask for a matric variable in a questionnaire there's

27:57 usually just an input field in which the person directly enters the value for example age or body weight let's look at what we've learned so far using an example imagine you're conducting a survey in a school to understand how pupils get to school here are questions you might ask each corresponding to a different level of measurement the first question could be what mode of transportation do you use to get to school bus car bicycle walk this is of course a nominal variable the answers can be categorized but there is no meaningful order this means that bus is not higher than bicycle walk is not

28:43 higher than car and so on and so forth if you want to analyze the results of this question you can count how many students use each mode of transportation and present it in a bar chart further you can ask ask how satisfied are you with your current mode of transportation choices might include very unsatisfied unsatisfied neutral satisfied very satisfied this is of course an ordinal variable you can rank the responses to see which mode of transportation ranks higher in satisfaction but the exact difference between satisfied and very satisfied for example or other options isn't quantifiable and the last question

29:29 how many minutes does it take you to get to school minutes to get to school is a metric variable here you can calculate the average time to get the school and use all standard statistical measures we can visualize this data with a histogram showing the distribution of times you get to school and compare the different Transportation modes so using nominal data we can categorize and count responses but cannot inere any order ordinal data allows us to rank responses but not to measure precise differences between ranks matric data enables us to measure exact differences between data points as already mentioned matric level

30:16 of measurement can be further subdivided into interval scale and ratio scale but what is the difference between interval and ratio level let's look at an example in a marathon of course the time of the marathon runners is measured let's say the first one took 2 hours and the last one finished the marathon in 6 hours here we can say that the fastest runner was three times as fast as the slowest or to put it the other way around the slowest one took three times as long as the fastest one this is possible because there is a true zero point at the beginning of the marathon where all Runners start from zero in this case we

31:01 have ratio level of measurement if however the stopwatch is forgotten to start at the beginning of the race and only the differences are measured starting from the fastest runner we don't have this true zero now the runners cannot be put in proportion in this case we can say how big the interval between the runners is for example the fastest runner is 4 hours was faster than the slowest runner but we cannot say that the fastest runner was three times as fast as the slowest this is because we don't know the absolute values for both Runners we still have equal intervals we can say things like Runner B finished one hour

31:48 after the fastest runner and Runner C finished 1 hour and 45 minutes after the fastest runner the time differences are measurable and meaningful but since there is no true zero point we can say the fastest runner was x times as fast as the slowest runner we only know how much lat that the other Runners finished relative to the fastest runner but not that total running times and in this case we have an interval level of measurement in summary while both interval and ratio scales have equal intervals and support similar operations like addition and subtraction ratio scales have a true zero point zero

32:35 represents the absence of the quantity being measured this allows meaningful multiplication and division and now a little exercise to check whether everything is clear to you first we have state of the US which is a nominal level of measurement this means the data is used for labeling or naming categories without without any quantitative value in this case the states are names with no inherent order or ranking next we have product ratings on a scale from 1 to five this is an example of ordinal data here the numbers do have an order or rank five is better than one but the intervals between the ratings are not

33:22 necessarily equal moving on to religious confession like the state stes this is also nominal the categories here such as different religions are for categorization and do not imply any order next we have CO2 emissions in the year which is measured on a metric ratio scale this level allows for the full range of mathematical operations including meaningful ratios zero emissions mean no emissions at all then we have telephone numbers although telephone numbers are numeric they are categorized as nominal they are just identifiers with no numerical value for

34:09 analysis care level of patience is another ordinal example this might include levels such as low medium and high care which indicate an order but not the exact difference between these levels living space in square meters is measured on a ratio scale like CO2 emissions Co sare meters mean there is no living space and comparisons like double or half are meaningful lastly we have chop satisfaction on a scale from 1 to four this is ordinal data it ranks satisfaction levels but the difference between each level isn't Quantified now we know what the level of

34:56 measurement is and we can go through the hypothesis tests that are most popular and discuss when to use which tests let's start with the video on the most common hypothesis test the tea test this video is about everything you need to know about the Tea test after this video you know what a te test is and when you use it what types of te tests there are what the hypotheses and the assumptions are how a te test is calculate it and how you interpret the results let's start with the first question what is a T Test the T Test is a statistical test procedure hm and what does the T Test do

35:42 the T Test analyzes whether there is a significant difference between the means of two groups for example the two groups may be patients who received once drag a and once drag B we would now like to know if there is a difference in blood pressure between these two groups now there are three different types of T tests the one sample T Test the independent samples T Test and the pair samples T Test when do we use a one sample T Test we use the one sample T Test when we want to compare the mean of a sample with a known reference mean

36:28 example a chocolate bar manufacturer claims that its chocolate bars weigh an average of 50 g to check this we take a sample of 30 bars and weigh them the mean value of this sample is 48 G now we can use a one sample T test to check if the mean of 48 G is significantly different from the claimed 50 g when do we use the independent samples T Test we use the T test for independent samples when we want to compare the means of two independent groups or samples we want to know if there is a significant difference between these means example

37:16 we would like to compare the effectiveness of two painkillers we randomly divide 60 people into two groups the first group receives track a and the second second group receives Str B using an independent T Test we can now test whether there is a significant difference in pain relief between the two drugs when we use the pair samples T Test we use the paired samples T Test to compare the means of two dependent groups example we want to know how effective a diet is to do this we weigh 30 people before the diet and then weigh exactly the same people after

38:01 the diet now we can look at the difference in weight between before and after for each subject we can now use a paired samples T test to test whether there is a significant difference in a paired sample the measurements are available in pairs the pairs result for example from repeated measurements with the same people independ dep samples are made up of people and measurements that are independent of each other here's an interesting note the paired samples T Test is very similar to the one sample T Test we can also think of the paired samples T Test as having one sample that

38:46 was measured at two different times we then calculate the difference between the paired values giving us a value for one sample the differ difference is 1's - 5 1's + 2 1's -1 and so on and so forth now we want to test whether the mean value of the difference just calculated deviates from a reference value in this case zero this is exactly what the one sample T Test does what are the assumptions for a t test of course we first need a suitable sample in the one sample T Test we need a sample and the reference value in the independent T Test we need two independent samples and

39:34 in the case of a pair T Test a paired sample the variable for which we want to test whether there is a difference between the means must be metric examples of matric variables are age body weight and income for example a person's level of education is not a metric variable in addition the matric variable must be normally distributed in all three test variants to learn how to test if your data is normally distributed watch my video test for normal distribution in case of an independent T Test the variances in the two groups must be approximately equal you can check whether the variances are

40:21 equal using lavine's test for more information watch my video on lavine's test so what are the hypotheses of the T Test let's start with the one sample T Test in the one sample T Test the null hypothesis is the sample mean is equal to the given reference value so there's no difference and the alternative hypothesis is the sample mean is not equal to the given reference value what about the independent samples T Test in the independent T Test the null hypothesis is the mean values in both groups are the same so there is no difference between the two groups and the alternative hypothesis is the mean values in both groups are not equal so

41:08 there is a difference between the two groups and finally the pair samples T Test in a pair T Test the Nile hypothesis is the mean of the difference between the pairs is zero and the alternative hypothesis is the mean of the difference between the pairs is not zero so now we know what the hypotheses are before we look at how the te test is calculated let us look at an example of why we actually need a te test let's say there is a difference in the length of study for a bachelor's degree between men and women in Germany our population is therefore made up of all graduates of a bachelor who have studied in Germany however as we cannot survey all Bachelor

41:56 graduates we draw a sample that is as representative as possible we now use the test to test the null hypothesis that there is no difference in the population if there is no difference in the population we will certainly still see a difference in study duration in the sample it would be very unlikely that we drew a sample where the difference would be exactly zero in simple terms we now want to know at what difference measured in a sample we can say that the duration of study of men and women is significantly different and this is exactly what the T Test answers but how do we calculate a T Test to do this we first calculate the T value to

42:44 calculate the T value we need two values first we need the difference between the means and then we need the standard deviation from the mean this is also Al known as the standard error in the one sample T Test we calculate the difference between the sample mean and the known reference mean s is the standard deviation of the collected data and N is the number of cases s / the square root of n is then the standard deviation from the mean which is the standard error in the dependent samples T Test we simply calculate the difference between the the two sample means to calculate the standard error we

43:31 need the standard deviation and the number of cases from the first and second sample depending on whether we can assume equal or unequal variance for our data there are different formulas for the standard error read more about this in our tutorial on data.net in a paired sample T Test we only need to calculate the difference between the paired values and calculate to mean from that the standard error is then the same as for a one sample T Test so what have we learned so far about the T value no matter which T Test we calculate the T value will be greater if we have a greater difference between the means and the T value will be smaller if the

44:18 difference between the means is smaller further the T value becomes smaller when we have a larger disperson of the mean so the more scattered the data the less meaningful a given mean difference is now we want to use the T test to see if we can reject the null hypothesis or not to do this we can now use the T value in two ways either we read the critical T value from a table or we simply calculate the P value from the T value we'll go through both in a moment but what is the P value a T Test over always test the null hypothesis that there is no difference so first we assume that there is no difference in the population

45:05 when we draw a sample this sample deviates from the null hypothesis by a certain amount the P value tells us How likely it is that we would draw a sample that deviates from the population by the same amount or more than a sample we drew thus the more the sample deviates from the null hypothesis the smaller the P value becomes if this probability is very very small we can of course ask whether the null hypothesis holds for the population perhaps there is a difference but at what point can we reject an Al hypothesis this border is called the significance level which is usually set at 5% so if there is only a

45:53 5% chance that we draw such a sample or one that is more different then we have enough evidence to assume that we reject the null hypothesis and to put it simple we assume that there is a difference that the alternative hypothesis is true now that we know what the P value is we can finally look at how the T value is used to determine whether or not the null hypothesis is rejected let's start with the path through the critical T value which you can read from from a table to do this we first need a table of critical T values which we can find on data.net under tutorials and T distribution let's start with the

46:39 two-tailed case we'll briefly look at the one tail case at the end of this video here below we see the table first we need to decide what level of significance we want to use let's choose a significance level of 0.05 or 5% then we look in this column at 1 - 0.05 which is 0.95 now we need the degrees of freedom in the one sample T Test and the paired samples T Test the degrees of freedom are simply the number of cases minus one so if we have a sample of 10 people there are 9 degrees of freedom in the independent sample T Test we add the

47:25 number of people from both samples and calculate that minus two because we have two samples note that the degrees of freedom can be determined in a different way depending on whether we assume equal or unequal variance so if we have a 5% significance level and 9 degrees of freedom we get a critical T value of 2.262 now on the one hand we've calculated a t value with the T Test and we have the critical T value if our calculated T value is greater than the critical T value we reject the null hypothesis for example suppose we calculate a t value of 2.5 this value is

48:14 greater than 2.262 and therefore the two means are so different that we can reject the N hypothesis on the other hand we can also calculate the P value for the T value we've calculated if we enter 2.5 for the T value and 9 for the degrees of freedom we get a P value of 0.034 the P value is less than 0.05 and we therefore reject the null hypothesis as a control we copy the T value of 2.262 here we get exactly a P value of 0.05 which is exactly the limit if you

49:00 want to calculate a t test with data tab you just need to copy your own data in this table click on hypothesis test and then select the variables of interest for example if you want to test whether gender has an effect on income you simply click on the two variables and automatically get a T Test calculated for independent samples here below you can read the P value if you're still unsure about the interpretation of the results you can simply click on interpretation in words a two-tail t test for independent samples equal variances assumed showed that the difference between female and male with

49:46 respect to the dependent variable salary was not statistically significant thus the null hypothesis is retained the final question now is what is the difference between directed hypothesis and undirected hypothesis in the undirected case the alternative hypothesis is that there is a difference for example there is a difference between the salary of men and women in Germany we don't care who earns more we just want to know if there is a difference or not in a directed hypothesis we are also interested in the direction of the difference for example example the alternative hypothesis might be that men earn more than women or

50:32 women earn more than men if we look at the T distribution graphically we can see that in the two-sided case we have a range on the left and the range on the right we want to reject the null hypothesis if we are either here or there with a 5% significance level both ranges have a probability of two .5% together just 5% if we do a one tail T Test the null hypothesis is rejected only if we are in this range or depending on the direction which we want to test in that range with a 5% significance level all 5% fall within this range we've seen how the test is a

51:20 powerful tool for comparing the means of two groups to determine why they differ sign significantly but what if we want to extend our analysis to more than two groups this is where analysis of variance or Anova comes into play so let's get started with Anova this video is about analysis of variance or Anova for short we discuss what an anova is and why you need it we look at the hypotheses and the assumptions for an anova and I will show you how to calculate an anova and what the equations behind an anova are finally we will discuss how to interpret the results and take a look at the posst hog test let's get started first of all

52:06 there are different types of analysis of variant the simplest and most common one is the oneway Anova and that's exactly what this video is about what is a oneway Anova the oneway Anova is a hypothesis test okay and what does the One Way Anova test and an NOA tests whether there are statistically significant differences between three or more groups more precisely it is tested whether there is a significant difference between the mean values of the groups an example you want to investigate whether there is a difference between fertilizers a b and c in terms of plant growth the analysis of variance now helps you to find out whether there is a significant

52:52 difference in plant growth between the three groups but doesn't it T Test do something similar that's true the T test tests whether there is a difference between two groups the analysis of variance is now an extension of the T test and it tests whether there is a difference between more than two groups so if you only had two fertilizers A and B that you wanted to compare you would use a t test if you have three or more different fertilizers you would use an anova okay that makes sense what are the hypothesis test it in an anova in an anova the null hypothesis is that the mean values of the groups are equal mathematically this can be expressed as mu1 is equal to mu2 is equal to Mu K

53:41 where mu1 to Mu K represents the mean values of the different groups and the alternative hypothesis is that the mean values of the groups are not equal this can be expressed mathematically as follows at least one mu is different where e stands for one of the groups under consideration what are the assumptions of an anova and how is it calculated let's look at this with the help of an example let's say you are a researcher and you want to find out whether three different drugs have a different effect on blood pressure so your research question is do the three drugs have a different effect on blood pressure the null hypothesis is there is no different between the three drugs in

54:28 terms of blood pressure and the alternative hypothesis is there is a difference between the three drugs in terms of blood pressure in order to calculate an anova we of course need data how do we get the data we obtain data by taking a sample from the population we need to analyze for example all people suffering from high blood pressure let's say we took a sample of 24 tests subjects we can then divide these 24 test subjects into three groups with each group receiving a different rack okay but now we still don't have any data we only have groups for now that's right in order to be able to calculate an anova we have to measure

55:14 something for each subject in our case the blood pressure we measure the blood pressure for each test person once at the beginning and once at the end of the treatment the difference between the two values tells us how the blood pressure has changed while taking the medication we have now collected data but what about the assumptions we still have to check them don't we exactly so that you can calculate an anova these assumptions must be met number one level of measurement first the levels of measurement for your variable must be appropriate for an anova the independent variable should be nominal such as the type of medic ation or the type of fertilizer applied the dependent

56:00 variable on the other hand must be metric like blood pressure or plant growth to summarize we need a variable that defines the different groups such as the different medications and the variable that reflects what is measured in a different groups for example blood pressure but now to the second assumption Independence the measurements should be independent I.E the measured value of one group should not be influenced by the measured value of another group the third assumption is that of normal distribution the data within the groups should be normally distributed this assumption becomes less important as the sample size increases but should still be evaluated especially for small samples if this assumption is

56:47 violated the cross called Wallace test can be used as an alternative if you would like to know how to test data for normal distribution please watch my video test for normal distribution and thus to the fourth assumption the variances in each group should be roughly the same in other words it should not be the case that we have a very large variance or a very small variance in one group compared to the other group this assumption can be tested with the Levine test you can find more information in my video on the Levine test if this assumption is not met the Welch Anova can be used as alternative okay but how does an anova work we want to know whether there is a difference between the groups to test

57:34 whether there is a difference the Anova uses the ratio of the variance between the groups and the variance within the groups what is the between group variance and what is the within group variance the variance between the groups measures how much the mean values of the groups differ from each other in our case the deviation of the mean values of groups a b and c in this case we would have a big variance in that case a small one what is the variance within the groups the within group variance measures how much the individual data points in each group fluctuate in this case we would have a large variance within the groups in that case a small

58:21 variance the ratio between the variance between the groups and the variance with within the groups is now the so-called F value or F statistic if the variance between the groups is small and the variance within the groups is large then we get a small F value in this case it is likely that these deviations or even larger ones occur purely by chance even if in reality there is no difference between the groups however if we have a small spread within the groups and a large spread between the groups then the F value is large it is then very unlikely that such a difference or an even more extreme difference would arise

59:06 purely by chance or to be more precise it is very unlikely that we will obtain such an F value or an even larger one therefore to assess whether the differences between the groups are statistically significant we use the F value however this F value does not give us a DE definite answer to assess the significance of the results more precisely we need the P value so let's calculate the P value let's say this is our data we have the values from the first second and third group so now we start and calculate the variance between the groups and the variance within the groups first of all we need the total mean and the mean values of the individual groups we obtain the total

59:52 mean by adding up all the values and dividing by the number of values we have a total of 24 values this gives us a total mean of 5.3 we get the mean values of the groups by simply adding up all the values of the respective group and dividing by the number of values per group now we've calculated all the required mean values and we can calculate the so-called sum of squares between the groups to do this we calculate the difference between each group mean and the total mean Square this and add up the results n is the number of values in the E Group so we get 2.5 - 5.3 sared + 8 - 5.3 sared +

1:00:44 5.5 - 5.3 sared the sum of the squares between the groups is therefore calculate the sum of squares within the groups to calculate this we subtract the mean of each group from each individual value within that group so we subtract the mean of the first group from each of its values the mean of the second group from each of its values and the mean of the third group from each of its values we Square the differences obtained and add everything up for example in group one we substract the the group average of 2.5 from the first value from the

1:01:30 second value and so on in total we get a sum of squares within the groups of 36 so now we've almost made it we've calculated the total mean and the group mean values we have calculated the sum of squares between the groups and within the groups and now we can calculate the variances within and between the groups in most cases however the term variance is not used but mean squares which we will now also adopt we obtain the mean squares between the groups by dividing the sum of squares between the groups by the number of degrees of freedom between the groups we've just calculated the sum of squares between the groups and the degrees of freedom result from the

1:02:16 number of groups minus one so in our case 3 - 1 which is equal to 2 we get a mean square of 60.6 7 so now we need the mean squares within the groups these are obtained by dividing the calculated sum of squares with in the groups by the degrees of freedom within the groups the degrees of freedom result from the total number of values in our case 24 minus the number of groups in our case three so we get 21 now we can calculate the F value to do this we divide the mean Square between the groups by the mean Square within the groups or if we take the expression from the beginning the variance between the groups by the

1:03:03 variance within the groups we get an F value of 3539 but what about the P value we can calculate the P value with an F distribution to do this we simply go to data.net we need the degrees of freedom between the groups in our case two the degrees of freedom within the groups in our case 21 and we need the F value which is calculated I.E 3539 we get a P value that is smaller than 0.01 so if we use the usual significance level of 5% we get a significant difference and we reject the null hypothesis that there is no difference between the three groups of course you

1:03:49 can simply calculate an anova online with data tab just copy your data into this table and click on Hy hypothesis test then simply select your desired variables for example blood pressure and medication and an NOA will now be calculated automatically if you don't know exactly how to interpret the results simply click on summary inverts or you can simply click on AI interpretation for most tables in this table we now get exactly the values that we just calculated by hand and we can also see here that we get a significant result as I said you can simply click on AI interpretation to help you understand the results now there's one more topic

1:04:34 to cover the post talk test a post talk test becomes necessary when an anova indicates a significant difference between groups while a NOA can confirm that differences exist it doesn't specify which groups are different from each other a post talk test helps to pinpoint exactly which groups differ from each other it performs a pairwise comparison between the groups indicating for example whether group a differs from group b or group C in our case the post talk test reveals that all groups differ significantly from one another however this isn't always the outcome it's possible that only group one differs from group two or that no individual

1:05:19 groups shows a significant difference even if the unov result is significant overall but what if you have not just one factor but two in this case you will need to perform a two-way Anova let's explore the two-way Anova what is a two-way Anova a two-way Anova is a statistical method used to test the effect of two categorical variables on a continuous variable the categorical variables are the independent variables for example the variable drag type with drug A and B and gender with female and male and the continuous variable is the

1:06:04 dependent variable for example the reduction in blood pressure so the two-way Anova is the extension of the one-way Anova while a oneway Anova tests the effect of a single independent variable on a dependent variable a twv Anova tests the effects of two independent variables the independent variables are called factors but what is a factor a factor is for example gender of a person with the levels male and female type of therapy with therapy a b and c or the field of study with medicine business administration psychology and Mathematics in an

1:06:51 analysis of variance a factor is therefore a nominal variable we use an anova whenever we want to test whether these levels have an influence on the so-call dependent variable you might want to test whether gender has an effect on salary whether therapy has an effect on blood pressure or whether field of study has an effect on length of study celer blood pressure and length of study will then be the dep dependent variables in each of these cases you test whether the factor has an effect on the dependent variable since you only have one factor in these cases you would use a oneway Anova okay you're right in

1:07:39 the first case we have a variable with only two categories so of course we would use the independent samples T Test but when do we use a two-way Anova we use a two factor analysis of variance when we have a second factor and we want to know whether this Factor also has an effect on the dependent variable we would also like to know whether in addition to gender the highest level of education has an impact on salary or we would like to include gender in addition to type of therapy or in the third case we would also like to know whether the university attended in addition to the field of study has an in fluence on the

1:08:26 length of study now we don't have one factor in all three cases but two factors in each case and since we now have two factors we use a two-way analysis of variance so in a one-way Anova we have one factor from which we create the groups if the factor we're looking at has three levels for example three different types of drug we will have three groups to compare in the the case of a two-way analysis of variance the group results from the combination of the levels of the two factors if we have one factor with three levels and one with two levels we have a total of six groups to compare but what kind of

1:09:12 statements can we make with a two-way Anova with the help of a two-way Anova we can answer three things whether the first Factor has an effect on the dependent variable whether the second Factor has an effect on the dependent variable and whether there is an interaction effect between the two factors but what about the hypotheses in a two-way Anova there are three null hypotheses and therefore also three alternative hypothesis the first null hypothesis is there is no significant difference between the groups of the first factor and the alternative hypothesis there is a significant difference between the groups of the first Factor the second Nile hypothesis

1:09:59 is there is no significant difference between the groups of the second factor and the alternative hypothesis there is a significant difference between the groups of the second factor and the third null hypothesis reflects the interaction Effect one factor has no effect on the fact of the other factor and the alternative hypothesis at least one fact Factor has an influence on the effect of the other factor and what about the assumptions for the test results to be valid several assumptions must be met number one normality the data within the groups should be normally distributed or alternatively

1:10:45 the residual should be normally distributed this can be checked with a quantile quantile plot Number Two homogeneity of variances the variance of data in groups should be equal this can be checked with the Lin test number three Independence the measurements should be independent I.E the measured value of one group should not be influenced by the measured value of another group number four measurement level the dependent variable should have a metric scale level but how to calculate a two-way Anova let's look at the example from the beginning we would like to know if Dr type and gender have an influence on the reduction in blood

1:11:31 pressure Dr type has the two levels drug A and B and gender has the two levels male and female to answer the question we collect data we randomly assigned patients to the treatment combinations and measured the reduction in blood pressure after a month for example the first patient receives track a is male and after 1 month a reduction in blood pressure of six was measured now let us answer the questions is there a main effect of drag type on the reduction in blood pressure is there a main effect of gender on the reduction in blood pressure and is there an interaction effect between drag type and gender on

1:12:17 the reduction in blood pressure for the calculation we can use either a statistical software like data tab or do it by hand first I will show you how to calculate it with data Tab and how to interpret the results at the end I will show you how to calculate the Anova by hand and go through all the equations to calculate a two-way Anova online simply visit data.net and copy your data into this table then click on hypothesis test under this tab you will find a lot of hypothesis tests and depending on which variable able you select you will get an appropriate hypothesis test suggested we want to know if drag type and gender

1:13:02 have an influence on the reduction in blood pressure so let's just click on all three variables data now automatically gives us a two-way Anova we can read the three null and the three alternative hypotheses here afterwards we get the descriptive statistics and the LaVine test for equal variance with the LaVine test we can check if the variances within the groups are equal the P value is greater than 0.05 so we assume equality of variance in the groups for this data and here we see the results of the analysis of variance we'll look at these in more detail in a moment but if you don't know

1:13:48 exactly how to interpret the results you can also just click on summary in words in addition you can check here if the requirements for the analysis of variance are met at all but now back to the results let's take a closer look at this table the first row tests the N hypothesis where drag type has an effect on the reduction in blood pressure the second row tests whether gender has an effect on the reduction in blood pressure and the third row tests if the interaction has an effect you you can read the P value in each case right at the back here let's say we set the significance level at 5% if our

1:14:34 calculated P value is less than 0.05 the null hypothesis is rejected and if the calculated P value is greater than 0.05 the N hypothesis is not rejected thus we see that all three p values are greater than 0.05 and therefore we cannot not reject any of the three null hypotheses therefore neither the drug type nor gender have a significant effect on the reduction in blood pressure and there's also no significant interaction effect but what does an analysis of variance actually do and why is the word variance in analysis of variance in a two-way

1:15:19 analysis of variance the total variance of the dependent variable is divided into the variance that can be explained by factor a the variance that can be explained by Factor B the variance of the interaction and the arrow variance actually SS is not the variance but the sum of squares we will discuss how to calculate the variance in this case in a moment but how can I imagine that the dependent variable has some variance in our example not every everyone will have the same reduction in blood pressure we now want to know if we can explain some of this variance by the variabl Str type

1:16:05 gender and their interaction the part that we cannot explain by these three terms accumulates in the eror if the result looked like this we would be able to explain almost all the variance by factors A and B and their interaction and we would only have a very small proportion that could not be explained this means that we can make a very good statement about the reduction in blood pressure by the variable drag type sex and interaction in this case it would be the other way around drug type gender and the interaction almost have no effect on the reduction in blood pressure and it all adds up in the arrow but how do we calculate the sum of

1:16:52 squares the F value and the P value here we have our data one's drug type with drug A and B and one's gender with male and female so these individuals are for example all male and have been given drug a first we calculate the mean values we need we calculate the mean value of each group so male and drag a that is 5.8 then male and Drug B that is 5.4 and we do the same for female then we calculate the mean value of all males

…

Share

More video summaries