"In regression analysis, when you use the first independent variable to indicate two groups (with values 0 and 1), the test statistic for the slope in regression is the same as the test statistic used in a two-sample t-test."
I intuitively understand what the concept is, but it is difficult to prove it mathematically, so please help.