jasp-stats / jasp-issues

This repository is solely meant for reporting of bugs, feature requests and other issues in JASP.
58 stars 29 forks source link

Enhancement Request - Polynomial Regression #172

Closed chrisbeardy closed 8 months ago

chrisbeardy commented 6 years ago

Using a polynomial regression often provides better results than a linear regression so it would be good to see the feature added in JASP.

Please google "how to do a multiple polynomial regression in R" for examples.

psychuser00 commented 1 year ago

I also second this feature request. I would also like for JASP to have in its multiple regression/generalized linear model modules support for polynomial regression. Quadratic, cubic, etc. independent variable terms. Thank you. I would like to use JASP for teaching my graduate statistics course and I'd like to demonstrate this feature to my class. I very much like also the flexplot incorporation into JASP - it's very helpful for visualizing interactions.

tomtomme commented 8 months ago

I second this too, and have requested this also in the context of the flexplot module here: https://github.com/jasp-stats/jasp-issues/issues/2138

tomtomme commented 8 months ago

Example from the duplicate #2486 image

dustinfife commented 8 months ago

Flexplot already does this. You can do quadratic and cubic, both in flexplot and in linear modeling

tomtomme commented 8 months ago

@dustinfife not completely. The formula is not displayed in the plot nor are the coefficients given by the "Regression Slopes and intercept" table. Those slopes and intercepts always display the fit of the linear model, even if visual fit is switched to poisson or cubic.

Also I just saw a bug in "Linear Modelling" where I switch the visual fit, but it always stays linear.

dustinfife commented 8 months ago

You're probably not doing it right. You have to click on the menu "Model Terms," check the box that says "Add as a polynomial" to specify which predictor needs to be squared (or cubed), then change the fitted line type to quadratic (or cubic). Once you do that, the line will bend and the tables will report the coefficient for the squared term.

tomtomme commented 8 months ago

Ah - sorry for the noise. This can be closed then! Thanks dustinfife!!!

@chrisbeardy I hope you agree!

Franck6S commented 8 months ago

Done. Thanks image

chrisbeardy commented 8 months ago

does this allow for multiple independent variables and therefore multiple coefficients? e.g. A = Intercept + CX + CY + CZ + CX^2 + CY^2 + CZ^2 + CXY + CXZ + CYZ where C is a coefficient. That's what I was after.

tomtomme commented 8 months ago

@chrisbeardy Yes!