Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

JASP and Statsmodels (Python) return different results

Dear colleagues,

I'm running a multiple linear regression analysis in Python's statsmodels and in JASP. I'm using the same dataset and, as far as I can understand, I'm using the same model. I'm pretty sure I'm coding it right in Python (see below). I assume this might be related to some underlying difference between JASP and statsmodels, but not sure. Am I right?

Any comment highly appreciated.

Thanks!

Code I'm using in python:
model = smf.ols('outcome ~ predictor1 + C(predictor2) + predictor1*C(predictor2)', data = dataset).fit()
print(model.summary())
(obs. predictor1 is continuous; predictor2 is categorical)

Comments

  • Hi fcorchs,

    JASP uses R, so the discrepancy will probably be between R and Python. If you post this issue on our GutHub page then the person responsible can look at the specific code (for details see https://jasp-stats.org/2018/03/29/request-feature-report-bug-jasp/). You will probably be asked to provide a small example. As an aside, there are no missing values anywhere, I hope? Also, JASP has correctly guessed the measurement level? (if not, you can adjust it in JASP)

    Cheers,
    E.J.

  • Hi E.J.

    Thanks for your reply. No missing, yes. I’ll check the measurement level and if it doesn’t work I’ll go ahead and write on GitHub. Now I’m having another similar problem, but python and R lm are returning the same results, both different of JASP. Basically the model above without the interaction.

    Best,

    Felipe
  • Hi Felipe,

    That suggests to me even more that it is an issue with the way the data are read in. But we'll see I guess. Please keep us posted!

    E.J.

Sign In or Register to comment.