Closed IshaanW closed 5 years ago
Make sure to drop missing data first. Check out the issue on GitHub regarding dropping data. You want to drop as little as possible. Some regression functions won't automatically drop missing data for you.
I was having trouble understanding how dropna() did not permanently drop Nan values and was able to fix the issue. Thank you!
I'm following the code used in lecture for a fixed effects regression using statsmodels to generate the fixed effects regression for the SeatBelts dataset. My line of code is:
fixedeffectsfit = smf.mixedlm('fatalityrate ~ sb_useage + speed65 + speed70 + ba08 + drinkage21 + np.log(income) + age', seatbelts, groups=seatbelts['state']).fit()
However, I'm getting the following error after running this code:
IndexError Traceback (most recent call last)