Skip to content

[Feature Request]: Predictions and prediction intervals for new observations in linear regressions #3714

@sfn-mes

Description

@sfn-mes

Description

To many the purpose of a regression model is to be able to predict responses for new observations. For linear models most would expect to get these with prediction intervals.

Purpose

Make regression useful also for prediction

Use-case

Prediction of new observations

Is your feature request related to a problem?

No

Is your feature request related to a JASP module?

Regression

Describe the solution you would like

I would want to be able to feed new covariate values into a regression model and obtain point predictions as well as prediction intervals.

Describe alternatives that you have considered

No response

Additional context

First: I have notice a similar feature request (#51) dating back to 2017. It does not ask for prediction intervals (I think) and does not specifically want predictions for new covariate values (the current versions of JASP allows me to save fitted values - not what I am looking for). But maybe this request should just be merged with the old one.

The formulas needed are "easy": lm::predict(model, newdata, intervals='p'). The tricky part is really how to get "newdata" into JASP and the results out. In JMP this is solved by putting the prediction equation(s) into the data window/data table as a formula. The user can write new covariate values into the data table and the predictions are calculated in the data table (which works as a spread sheet). However, with JASP's "any change to the data changes all analyses instantly"-policy this is probably a dangerous solution.

I can think of a work-around using the console (if I was able to interact directly with M1 as an lm-object, I could just use lm::predict, but typing in a data.frame for newdata would be a hassle), but nothing that is user friendly.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions