Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Remove constraint on the number of fixed effects #491

Open
LulinS opened this issue Jan 9, 2023 · 1 comment
Open

ENH: Remove constraint on the number of fixed effects #491

LulinS opened this issue Jan 9, 2023 · 1 comment

Comments

@LulinS
Copy link

LulinS commented Jan 9, 2023

I am wondering if it's possible to remove the constraint on the number of fixed effects in PanelOLS().

@LulinS LulinS changed the title ENH ENH: Remove constraint on the number of fixed effects Jan 9, 2023
@NauelSerraino
Copy link

I think that some how you can overcome the issue by creating a column that merges the various categorical variables that you want to add as fixed effects.

Let's say you want to study how the crime_rate is influenced by the number of police_stations within 5 km from the crimes occurencies. The variables available are neighborhoods, cities , states (also time of occurence is a variable itself)

Normally you could set only one among neighborhoods, cities, states as fixed effect. However, you could simply set the 3 components as an unique index of the panel, as follows:

df['unique_index'] = df['neighborhoods'] +"_"+ df['cities']+ "_"+ df['states'] 
df= df.set_index(['unique_index', 'month_year'])

However this applies only if we have not individuals, which are already unique by definition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants