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
Related Posts with Fit plots based on multivariable linear regression
Fixed Effects Model with Time Invariant Independent VariablesI am working with a panel data set in Stata 16.1 that has 14,690 observations and 19 variables. I am…
Interpreting coefficients in ologit regressionsDear everyone, I am a bit confused in interpreting the coefficients in an ologit regression when bo…
IV 2SLS when dependent variable in 1st stage differs from endogenous variable in 2nd stageDear All, I am trying to implement on Stata 14.0 the same model adopted in Remolona, Scatigna and W…
Heat maps according to datesDear friends, I am interested in build the attached graph. I was exploring in stata with several com…
query about stata codeHello, I would like to confirm whether I generate a variable in a proper way. The definition is as f…
Subscribe to:
Post Comments (Atom)
0 Response to Fit plots based on multivariable linear regression
Post a Comment