Here\'s the code that will reproduce something similar to what I\'m doing
import pandas as pd import numpy as np import scipy as sp from statsmodels.sandbox.r