I have taken several stats classes and. Have seen many models in action like the normal, poisson, dirchet, etc. and seen several inference tests in action like chisq, ttest and anova. However I'm interested in the theory behind such distributions, and also in the method by which the lookup values for test statistics and p-values are calculated for given inference tests.
What type of book or math class do I need to take to learn this? Additionally, if anyone can recommend online courses or resources that deal with such topics I would be grateful.