I want to plot a simple scatter plot with the Stata classical dataset auto,dta.
Before regression, for the purpose of interpretation, I centered the two continuous variables length and weight and created two continuous variables c_weight, and c_length,respectively.
However, the Stata syntax is wrong when I try to do the scatter plot.
webuse auto,clear
egen l=mean(length)
egen w=mean(weight)
gen c_weight=weight-w
gen c_length=length-l
reg price c_weight c_length i.foreign
scatter price mpg if foreign==1 & weight==c_weight & length==c_length
There is no any point in the scatter plot.
Can someone help me to solve this problem?
Thank you!
Before regression, for the purpose of interpretation, I centered the two continuous variables length and weight and created two continuous variables c_weight, and c_length,respectively.
However, the Stata syntax is wrong when I try to do the scatter plot.
webuse auto,clear
egen l=mean(length)
egen w=mean(weight)
gen c_weight=weight-w
gen c_length=length-l
reg price c_weight c_length i.foreign
scatter price mpg if foreign==1 & weight==c_weight & length==c_length
There is no any point in the scatter plot.
Can someone help me to solve this problem?
Thank you!

Comment