Dear Statalisters,
I am wondering whether there is a way to plot the fitted line from multivariate linear & quadratic regressions.
For example, in simple linear regression, I would do it this way:
However, when I try to do this in multivariate linear regression:
It gives me a jagged line plot since the predicted values take into account all the covariates included in the model.
Regarding this, I'd like to ask:
Is it possible to plot a linear fitted line for the multivariate model (i.e. just take into account the coefficient for the variable weight after adjusting for length and turn )
I would also like to fit a multivariate quadratic model, but I am guessing the solution would be similar.
Thanks for your help!
Regards,
Albert
I am wondering whether there is a way to plot the fitted line from multivariate linear & quadratic regressions.
For example, in simple linear regression, I would do it this way:
Code:
sysuse auto, clear reg mpg weight predict mpg_hat1 line mpg_hat1 weight, sort *or maybe simply twoway (lfit mpg weight)
Code:
sysuse auto, clear reg mpg weight length turn predict mpg_hat2 line mpg_hat2 weight, sort
Regarding this, I'd like to ask:
Is it possible to plot a linear fitted line for the multivariate model (i.e. just take into account the coefficient for the variable weight after adjusting for length and turn )
I would also like to fit a multivariate quadratic model, but I am guessing the solution would be similar.
Thanks for your help!
Regards,
Albert
Comment