Dear community,

I would like to create a two-way plot of two continuous variables. STATA's fit plots offer an intuitive way to facilitate visualisation of a univariable linear regression.
I was wondering whether this option exists also for multivariable linear regression, or otherwise how to best solve this.

So far, I have tried to run my weighted multivariable linear regression equations and create linear predictions for subsequent utilization in STATA's twoway command:

regress dep_var indep_var conf1 conf2 conf3 [aweight=indep_var]
predict dep_var_prediction

scatter dep_var indep_var || dep_var_prediction indep_var, sort

This approach yields a wiggly line if plotted against the independent variable (Screenshot 1). This is in contrast to the straight line that is plotted if linear predictions are made based on the crude linear regression model (Screenshot 2) i.e. ...

regress dep_var indep_var[aweight=indep_var]
predict dep_var_prediction_crude

Is it possible to produce a plot with a straight line based on the multivariable regression equation? I am certain that the solution might probably be very obvious, yet I have been unable to see it. Many thanks for any advice in advance.

Best wishes,
HannesArray Array