# Should I do Chi-square or T-test before running a regression?

In many articles before running a regression authors do T-test or Chi-square test to check if there’s a significant difference between the variables in 2 subsamples. In my case variable of interest - long working hours, so should I do these tests on subsamples: people working long hours and not doing this? I don’t understand why I need this if I run a regression afterwards. Why people usually do tests?

The reason why it is important to test for whether the difference is statistically significant is that when you split sample into subsample of course there will be some differences in the estimated $$\hat{\beta}$$ just purely due to random chance.
For example, if in subsample A you estimate $$\hat{\beta}_{iA}=4$$ and in subsample B you estimate $$\hat{\beta}_{iB}=4.5$$ you cannot automatically claim that in subsample B the effect is truly larger by 0.5. It might be the 0.5 difference can be attributed fully to random chance.
In order to see if the difference is really significant you should use some test to test $$H_0: \hat{\beta}_{iA}- \hat{\beta}_{iB} = 0$$ against alternative that the difference is non-zero. Appropriate test will depend on specific of your research, $$t$$-test and $$\chi^2$$ tests are common but not only tests that can be used.