Uploaded December 2021 | Updated September 2026, 2 weeks ago
In this video tutorial I show you how to use Julia to estimate a p value for the difference in means for a numerical variable between two groups. This helps you to develop an inuitive understanding of expressing the likelihood of the difference that you find in your data.
Under a simple null hypothesis there is no difference in the mean of a variable between two groups. This means that we can randomly reassign individuals / instances between the two groups and that should not change the means. If our test statistic of interest is the difference in means, we can do this random reassignment over and over again, each time recording our test statistic. This will build up a sampling distribution of the test statistic and we can compare our original test statistic with this sampling distribution.
You can watch my video on installing environments for your Julia projects at youtube.com/watch?v=MC-wjQTXOOA
The file is available at github.com/juanklopper/Julia-for-scientifc-computing/blob/master/ResamplingUnderTheNullHypothesis.jl
There are chapter markers below if you want to skip ahead.
00:00:00 Introduction
00:00:28 Julia Language
00:00:49 Visual Studio Code
00:01:00 Terminal
00:02:08 Lauch Visual Studio Code
00:02:28 Julia Extension for Visual Studio Code
00:03:22 Contents of the tutorial
00:04:25 Julia packages used in this tutorial
00:05:32 Generating random data
00:08:23 Making sub-DataFrames
00:09:48 Extracting vectors from a DataFrame
00:11:06 Descriptive statistics
00:12:05 Data visualization
00:14:28 Test statistic
00:15:14 Reassignment under the null hypothesis
00:18:30 Visualize the sampling distribution
00:20:06 Estimating a p value
00:21:29 Verifying the p value
00:21:54 End
In this video tutorial I show you how to use Julia to estimate a p value for the difference in means for a numerical variable between two groups. This helps you to develop an inuitive understanding of expressing the likelihood of the difference that you find in your data.
Under a simple null hypothesis there is no difference in the mean of a variable between two groups. This means that we can randomly reassign individuals / instances between the two groups and that should not change the means. If our test statistic of interest is the difference in means, we can do this random reassignment over and over again, each time recording our test statistic. This will build up a sampling distribution of the test statistic and we can compare our original test statistic with this sampling distribution.
You can watch my video on installing environments for your Julia projects at youtube.com/watch?v=MC-wjQTXOOA
The file is available at github.com/juanklopper/Julia-for-scientifc-computing/blob/master/ResamplingUnderTheNullHypothesis.jl
There are chapter markers below if you want to skip ahead.
00:00:00 Introduction
00:00:28 Julia Language
00:00:49 Visual Studio Code
00:01:00 Terminal
00:02:08 Lauch Visual Studio Code
00:02:28 Julia Extension for Visual Studio Code
00:03:22 Contents of the tutorial
00:04:25 Julia packages used in this tutorial
00:05:32 Generating random data
00:08:23 Making sub-DataFrames
00:09:48 Extracting vectors from a DataFrame
00:11:06 Descriptive statistics
00:12:05 Data visualization
00:14:28 Test statistic
00:15:14 Reassignment under the null hypothesis
00:18:30 Visualize the sampling distribution
00:20:06 Estimating a p value
00:21:29 Verifying the p value
00:21:54 End










