Pythonを使って回帰分析を行う。使用するライブラリはStatsmodelsである。 In [78]: %matplotlib inline まず対象となるデータを読み込む。これはR処理系に付属しているattitudeというデータを write.csv(attitude, "attitude.csv", quote=FALSE, row.names=FALSE) でCSVにしたものである。 In [79]: attitude = pd.read_csv('attitude.csv') attitude.columns Out[79]: Index([u'rating', u'complaints', u'privileges', u'learning', u'raises', u'critical', u'advance'], dtype='object') この記事を書くにあたって参考