import wooldridge as wooimport statsmodels.formula.api as smfimport pandas as pdgpa2 = woo.dataWoo('gpa2')reg = smf.ols(formula='colgpa ~ sat + hsperc + hsize + I(hsize**2)', data=gpa2)results = reg.fit()# define three sets of regressor variables:cvalues2 = pd.DataFrame({'sat': [1200, 900, 1400, ],'hsperc': [30, 20, 5], 'hsize': [5, 3, 1]},index=['newPerson1', 'newPerson2', 'newPerson3'])# point estimates and 95% confidence and prediction intervals:colgpa_PICI_95 = results.get_prediction(cvalues2).summary_frame(alpha=0.05)print(f'colgpa_PICI_95: \n{colgpa_PICI_95}\n')# point estimates and 99% confidence and prediction intervals:colgpa_PICI_99 = results.get_prediction(cvalues2).summary_frame(alpha=0.01)print(f'colgpa_PICI_99: \n{colgpa_PICI_99}\n')
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。