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
VARNAME dialog elementDear All, While programming a dialog one can use an option numeric for the VARNAME dialog elements,…
replacing data of two row in only one row.i have data like below Code: * Example generated by -dataex-. To install: ssc install dataex clear …
Pooled-Cross Sectional Data - nhis_alcohol.dtaHello, I am writing an Empirical Paper on the effect of alcohol on labor market outcomes. The data i…
Truncate Y-axis with twoway function graphHi, folks. I've been using Stata for data management and analysis for quite a few years, but I've re…
Regression and heteroskedasticityGood day everyone! I am just starting my path and learning use of Stata. Can someone help me to sol…
Subscribe to:
Post Comments (Atom)
0 Response to Fit plots based on multivariable linear regression
Post a Comment