Hello great statisticians,
I am a bit confused with using lfit vs predicted values. I have the data below and my codes: sbp bmi and women are 3 variables.
use http://www.stats4life.se/data/fhs, clear
regress sbp bmi women
predict predicted_sbp1
twoway (lfit sbp bmi if women==1, lcolor(red)) (lfit sbp bmi if women==0, lcolor(blue)), ytitle(Predicted SBP) xtitle(BMI kg/m2) legend(on order(1 "Women" 2 "Men")) scheme(s1color)
twoway (connected predicted_sbp1 bmi if women==1, lcolor(maroon) mcolor(maroon) msize(tiny) msymbol(point)) ///
(connected predicted_sbp1 bmi if women==0, lcolor(green) mcolor(green) msize(tiny) msymbol(point)), ///
ytitle(Predicted mean SBP) xtitle(BMI kg/m2) ///
legend(on order(1 "Women" 2 "Men")) scheme(s1color)
Why do these two graphs are different in shapes? Shouldn't they be the same.
May be I have not understood the logic of regression. Can someone help me to clarify this? Please.
Related Posts with linear regression
Estimates of Marginal Effects after GMMHello Experts and Researchers ! Could anyone suggest me the code and command on how to estimate marg…
Why stricter the condition, the higher probability?I am using joint null test if all averaging effect of these variables (dkt_4 dkt_3 dkt_2 dkt_1) is 0…
Panel Data Regression on Gravity ModelHi everyone, I am doing an gravity model analysis on panel data of 10 countries for 30 years. This …
ivtobit first stage R2Hi stata users, Currently, I am estimating an econometric model with IVTOBIT in order to address so…
permute with reghdfeDear All, Please, I am using reghdfe absorbing a(counties years). I want to 'scramble' years, assign…
Subscribe to:
Post Comments (Atom)
0 Response to linear regression
Post a Comment