>>> import statsmodels.api as sm >>> from statsmodels.tsa.stattools import grangercausalitytests >>> import numpy as np >>> data = sm.datasets.macrodata.load_pandas() >>> data = data.data[["realgdp", "realcons"]].pct_change().dropna()