I'm (a Python newbie) writing Python code to mimic outputs in SAS and want to run a multinomial logistic regression on the SAS Wallet data set. I've done normal logistic regression previously on other data using statsmodels.Logit, but now am using statsmodels.MNLogit. According to the API (https://www.statsmodels.org/stable/generated/statsmodels.discrete.discrete_model.MultinomialResults.html#statsmodels.discrete.discrete_model.MultinomialResults) there is a .wald_test() method on the fitted MultinomialResults model, but it's throwing "TypeError: decoding to str: need a bytes-like object, tuple found" when I try to use it with a String/tuple parameter value for r_matrix (there are also no examples for how the test should be used on the wald_test() page (https://www.statsmodels.org/stable/generated/statsmodels.discrete.discrete_model.MultinomialResults.wald_test.html#statsmodels.discrete.discrete_model.MultinomialResults.wald_test).
This is the code I input (where df is a pandas dataframe of the Wallet data):
#Define X and Y
X = df[['Male','Business','Punish','Explain']]
X = sm.add_constant(X)
Y = df['Wallet']
#Fit model
mnlogit_1 = sm.MNLogit(Y,X).fit()
#Run Wald test (on constant)
wald = ('const = 0')
Results = mnlogit_1.wald_test(wald)
print("const:", Results)
The same code works for sm.Logit() on a different data set (one that works with binomial logistic regression). Does anyone have an idea for what's going wrong? Thanks :)