How to have multiple independent value columns using statsmodels quantreg

537 Views Asked by At

Right now I'm trying to use statsmodels.formula.api's quantreg by putting in the formula and the dataframe by doing smf.quantreg('<independant values> ~ <dependant values>', df).fit(q=0.9) like in https://www.statology.org/quantile-regression-in-python/ However I cannot find how to structure the formula in a way to take multiple independant values, I have tried going with the structure of 'xValue1, xValue2 ~ yValue' however this causes me to get row mismatch error, making me think that statsmodels is assuming my xValues are rows and not columns.

1

There are 1 best solutions below

0
On BEST ANSWER

This should work

smf.quantreg('yValue ~ xValue1 + xValue2 + xValue3', df).fit(q=0.9)