def index_trim_outlier(resid, k):
    sort_index = np.argsort(np.abs(resid))
    # index of non-outlier
    trimmed_index = np.sort(sort_index[:-k])
    outlier_index = np.sort(sort_index[-k:])
    return trimmed_index, outlier_index


#Comparing estimation results for ols, rlm and wls with and without outliers
#---------------------------------------------------------------------------

#ols_test_fit = sm.OLS(data.endog, data.exog).fit()
User logout
dataset/ETHPy150Open statsmodels/statsmodels/examples/incomplete/wls_extended.py/index_trim_outlier--crossover with--dataset/ETHPy150Open treeio/treeio/treeio/core/views.py/user_logout