Python: How to evaluate the residuals in StatsModels?
<p>I want to evaluate the residuals: (y-hat y).</p>

<p>I know how to do that:</p>

<pre><code>df = pd.read_csv('myFile', delim_whitespace = True, header = None)
df.columns = ['column1', 'column2']
y, X = ps.dmatrices('column1 ~ column2',data = df, return_type = 'dataframe')
model = sm.OLS(y,X)
results = model.fit()
predictedValues = results.predict()
#print predictedValues
yData = df.as_matrix(columns = ['column1'])
res = yData - predictedValues
</code></pre>

<p>I wonder if there is a Method to do this (?).</p>