I have an application with a function that performs simple linear regression between two arrays (one predictor variable) and returns slope, intercept and R-squared as outputs.

Is there a way to create a multiple regression output with multiple predictor variables using this function? Or if I could even just get the R-squared of such a model using the R-squared's of the individual SLR's, that would be valuable too.

For example, say I want a multiple regression model with two predictors. I know that if I created a SLR model with one predictor and obtained regression coefficients, I could NOT obtain coefficients for the other predictor variable by regressing these residuals on the other predictor. However, if I did perform this, then regressed these new residuals back on the first predictor variable again, and repeated this over many iterations, could there be some convergence eventually to the estimates I'd obtain from using multiple regression?

  • $\begingroup$ This must be a dup, but I cannot find it $\endgroup$ – kjetil b halvorsen Feb 7 at 16:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.