小编dre*_*dre的帖子

Python中的模型输出`to_excel`?

运行 MixedLM 并希望将输出推送到 Excel 或 CSV,请参阅下面的模型代码和输出:

model = smf.mixedlm('y_var ~ gas_prices', dfModel, 
                 groups = dfModel['region'])
mdf = model.fit()
print(mdf.summary())

                Mixed Linear Model Regression Results
======================================================================
Model:                MixedLM   Dependent Variable:   yVar 
No. Observations:     420       Method:               REML            
No. Groups:           4         Scale:                45635645671.2271
Min. group size:      105       Likelihood:           -5720.8133      
Max. group size:      105       Converged:            Yes             
Mean group size:      105.0                                           
----------------------------------------------------------------------
              Coef.     Std.Err.    z    P>|z|    [0.025      0.975]  
----------------------------------------------------------------------
Intercept  3241461.947 112718.823 28.757 0.000 3020537.112 3462386.781
gas_prices -118128.471  46931.809 -2.517 0.012 -210113.126  -26143.816
xVar2          275.017 …
Run Code Online (Sandbox Code Playgroud)

python python-3.x pandas statsmodels

5
推荐指数
1
解决办法
4328
查看次数

标签 统计

pandas ×1

python ×1

python-3.x ×1

statsmodels ×1