有没有一种方法可以估算python statsmodels模型中的泊松交互作用?

问题描述 投票:0回答:1

Python中的statsmodels是否可以估算置信区间为95%的交互?这将是模型参数估计值的线性组合。

给出下面的示例,我想得到在“那里”的人中处于手臂“ b”的效果,这将需要估计模型参数的线性组合:

臂+ 臂*位置,但还包括适当的置信区间。我知道mod.paramsmod.conf_int(),但是statsmodels是否有另一种用于线性组合的方法?import random import pandas as pd import statsmodels.api as sm import patsy import numpy as np cases = np.array([random.randint(0,10) for i in range(200)]) arm = [random.choice(['a', 'b']) for i in range(200)] place = [random.choice(['here', 'there']) for i in range(200)] df = pd.DataFrame({'arm': arm, 'place': place}) exog = patsy.dmatrix('arm + place + arm * place', df, return_type='dataframe') mod = sm.GLM(endog=cases, exog=exog, family=sm.families.Poisson()).fit() mod.summary()

Python中的statsmodels是否可以估算置信区间为95%的交互?这将是模型参数估计值的线性组合。给定以下示例,我将...

python statsmodels
1个回答
0
投票
我不确定Statsmodels incorporates the Delta Method的程度和程度。
© www.soinside.com 2019 - 2024. All rights reserved.