2016-04-04 1 views
1

私はstatsmodelsチュートリアルでは、この第一の例を次のようだ:statsmodels.formula.apiのolsを使用する - 定数項を削除するには?

http://statsmodels.sourceforge.net/devel/

どのように私はオールで線形近似のための定数項を使用しないように指定するのですか? shown here in the section on Operatorsとして

# Fit regression model (using the natural log of one of the regressors) 
results = smf.ols('Lottery ~ Literacy + np.log(Pop1831)', data=dat).fit() 

答えて

3

、あなたが使用することができ、 "-1" 式の文字列に切片項を削除するには:

results = smf.ols('Lottery ~ Literacy + np.log(Pop1831) - 1', data=dat).fit() 
関連する問題