move statsmodels import to function that uses it