Skip to main content

panel

Based on the regression type, this function decides what regression to run.

Source Code: [link]

openbb.econometrics.panel(Y: pd.DataFrame, X: pd.DataFrame, regression_type: str = "OLS", entity_effects: bool = False, time_effects: bool = False)

Parameters

NameTypeDescriptionDefaultOptional
Ypd.DataFrameDataframe containing the dependent variable.NoneFalse
Xpd.DataFrameDataframe containing the independent variables.NoneFalse
regression_typestrThe type of regression you wish to execute.OLSTrue
entity_effectsboolWhether to apply Fixed Effects on entities.FalseTrue
time_effectsboolWhether to apply Fixed Effects on time.FalseTrue

Returns

TypeDescription
AnyA regression model

Examples

from openbb_terminal.sdk import openbb
df = openbb.econometrics.load("wage_panel")
df = df.set_index(["nr","year"])
X = df[["exper","educ","union"]]
Y = df["lwage"]
pooled_ols_model = openbb.econometrics.panel(Y,X,"POLS")
print(pooled_ols_model.summary)
PooledOLS Estimation Summary
================================================================================
Dep. Variable: lwage R-squared: 0.1634
Estimator: PooledOLS R-squared (Between): 0.1686
No. Observations: 4360 R-squared (Within): 0.1575
Date: Sun, Nov 13 2022 R-squared (Overall): 0.1634
Time: 13:04:02 Log-likelihood -3050.4
Cov. Estimator: Unadjusted
F-statistic: 283.68
Entities: 545 P-value 0.0000
Avg Obs: 8.0000 Distribution: F(3,4356)
Min Obs: 8.0000
Max Obs: 8.0000 F-statistic (robust): 283.68
P-value 0.0000
Time periods: 8 Distribution: F(3,4356)
Avg Obs: 545.00
Min Obs: 545.00
Max Obs: 545.00
Parameter Estimates
==============================================================================
Parameter Std. Err. T-stat P-value Lower CI Upper CI
------------------------------------------------------------------------------
const -0.0308 0.0620 -0.4965 0.6196 -0.1523 0.0908
exper 0.0561 0.0028 20.220 0.0000 0.0507 0.0616
educ 0.1080 0.0045 24.034 0.0000 0.0992 0.1168
union 0.1777 0.0172 10.344 0.0000 0.1441 0.2114
==============================================================================