TransWikia.com

Solve a regression equation algebraically in python

Data Science Asked on January 6, 2021

I fit a regression model using python statsmodels.formula.api package and obtain the coefficients/results. Here’s the model:

Price ~ Availability + Income + unemployment + labor_force + HH

The coefficients are:

coef    
Intercept   18.8172
Availability 0.0860 
Income  9.213e-05   
unemployment -1.562e-05 
labor_force 5.78e-06

I’d like to calculate the value of Availability for when Price = 0 and for different values of independent variable which vary by time. Basically, solve for Availability when Price = 0.

0 = Intercept + b1 * Avail + b2 * Income + b3 * U + b4 * L

I need python to solve this equation for Avail.

I realize I can do this with a python function by simply solving the equation, ,however, I was wondering if there are any in built methods I could use to obtain the equation and solve?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP