Presentation is loading. Please wait.

Presentation is loading. Please wait.

Eva Ørnbøl + Morten Frydenberg

Similar presentations


Presentation on theme: "Eva Ørnbøl + Morten Frydenberg"— Presentation transcript:

1 Eva Ørnbøl + Morten Frydenberg
Homework: 1.1 Sunday, 21 April 2019 graph box scl, over(bmi_who) Linear and Logistic Regression: Homework

2 Eva Ørnbøl + Morten Frydenberg
Homework: 1.1 Sunday, 21 April 2019 hist scl, by(bmi_who) Linear and Logistic Regression: Homework

3 Eva Ørnbøl + Morten Frydenberg
Sunday, 21 April 2019 Homework: 1.2 xi: regress scl sbp i.sex i.bmi_who i.bmi_who _Ibmi_who_ (naturally coded; _Ibmi_who_0 omitted) i.sex _Isex_ (naturally coded; _Isex_1 omitted) Source | SS df MS Number of obs = F( 5, 4652) = Model | Prob > F = Residual | R-squared = Adj R-squared = Total | Root MSE = scl | Coef. Std. Err t P>|t| [95% Conf. Interval] sbp | _Ibmi_who_1 | _Ibmi_who_2 | _Ibmi_who_3 | _Isex_2 | _cons | Linear and Logistic Regression: Homework

4 Eva Ørnbøl + Morten Frydenberg
Sunday, 21 April 2019 Homework: 1.3 scl | Coef. Std. Err t P>|t| [95% Conf. Interval] sbp | _Ibmi_who_1 | _Ibmi_who_2 | _Ibmi_who_3 | _Isex_2 | _cons | sbp: the expected difference in scl between two persons of the same gender and in the same bmi group who differ one unit of sbp. sbp: the expected difference in scl between two persons who differ one unit of sbp, “adjusted” for gender and bmi group in a model without interaction. Linear and Logistic Regression: Homework

5 Eva Ørnbøl + Morten Frydenberg
Sunday, 21 April 2019 Homework: 1.3 scl | Coef. Std. Err t P>|t| [95% Conf. Interval] sbp | _Ibmi_who_1 | _Ibmi_who_2 | _Ibmi_who_3 | _Isex_2 | _cons | _Ibmi_who_3: the expected difference in scl between a obese (BMI>30 kg/m2) person and a underweight person, “adjusted” for gender and blood pressure. Linear and Logistic Regression: Homework

6 Eva Ørnbøl + Morten Frydenberg
Sunday, 21 April 2019 Homework: 1.3 scl | Coef. Std. Err t P>|t| [95% Conf. Interval] sbp | _Ibmi_who_1 | _Ibmi_who_2 | _Ibmi_who_3 | _Isex_2 | _cons | _Isex_2: the expected difference in scl between a woman and a man “adjusted” for blood pressure and bmi group. Linear and Logistic Regression: Homework

7 Eva Ørnbøl + Morten Frydenberg
Homework: 1.3 Sunday, 21 April 2019 Linear and Logistic Regression: Homework

8 Eva Ørnbøl + Morten Frydenberg
Sunday, 21 April 2019 Homework: 1.4 gen sbp85=sbp-85 char sex [omit]2 char bmi_who [omit]1 xi: regress scl sbp85 i.sex i.bmi_who scl | Coef. Std. Err t P>|t| [95% Conf. Interval] sbp_85 | _Ibmi_who_0 | _Ibmi_who_2 | _Ibmi_who_3 | _Isex_1 | _cons | The expected value of a woman in bmi group 1 with sbp of 85 is: (204.3 ; 210.7) . Linear and Logistic Regression: Homework

9 Homework: 1.5 -----------------------------------------------------
Variable | model model 1 model 3 sbp | | dbp | | _Ibmi_who_1 | | _Ibmi_who_2 | | _Ibmi_who_3 | | _Isex_2 | | _cons | | N | df_r | F | rss | legend: b/se

10 Homework: 1.5

11 xi: regress scl sbp sbp2 i.sex i.bmi_who
Homework: 1.6 gen sbp2=sbp^2 xi: regress scl sbp sbp2 i.sex i.bmi_who i.bmi_who _Ibmi_who_ (naturally coded; _Ibmi_who_0 omitted) i.sex _Isex_ (naturally coded; _Isex_1 omitted) Source | SS df MS Number of obs = F( 6, 4651) = Model | Prob > F = Residual | R-squared = Adj R-squared = Total | Root MSE = scl | Coef. Std. Err t P>|t| [95% Conf. Interval] sbp | sbp2 | _Ibmi_who_1 | _Ibmi_who_2 | _Ibmi_who_3 | _Isex_2 | _cons |

12 Homework: 1.6

13 Eva Ørnbøl + Morten Frydenberg
Sunday, 21 April 2019 Homework: 1.6 gen sbp85=sbp-85 gen sbp285=sbp85^2 char sex [omit]2 char bmi_who [omit]1 xi: regress scl sbp85 sbp285 i.sex i.bmi_who scl | Coef. Std. Err t P>|t| [95% Conf. Interval] sbp_85 | sbp2_85 | _Ibmi_who_0 | _Ibmi_who_2 | _Ibmi_who_3 | _Isex_1 | _cons | The expected value of a woman in bmi group 1 with sbp of 85 is: (189.7 ; ). Compared to the result from model 1: (204.3 ; 210.7) Linear and Logistic Regression: Homework

14 Homework: 1.7 ----------------------------------------
Variable | Model Model 1 sbp | | bmi | | _Isex_2 | | _Ibmi_who_1 | | _Ibmi_who_2 | | _Ibmi_who_3 | | _cons | | N | df_r | F | rss | legend: b/se

15 Homework: 1.7

16 Homework: 1.8 Original scl: residuals in bmi group for both genders.

17 Homework: 1.8 Original scl:

18 Homework: 1.8 Original scl:

19 Homework: 1.8 Ln transformed scl: residuals in bmi group for both genders.

20 Homework: 1.8 Ln transformed scl:

21 Homework: 1.8 Ln transformed scl:

22 xi: regress lnscl i.sex*sbp_85 i.sex*i.bmi_who
Homework: 1.9 gen lnscl=ln(scl) xi: regress lnscl i.sex*sbp_85 i.sex*i.bmi_who i.sex _Isex_ (naturally coded; _Isex_1 omitted) i.sex*sbp _IsexXsbp_# (coded as above) i.bmi_who _Ibmi_who_ (naturally coded; _Ibmi_who_0 omitted) i.sex*i.bmi_who _IsexXbmi_#_# (coded as above) Output omitted lnscl | Coef. Std. Err t P>|t| [95% Conf. Interval] _Isex_2 | sbp_85 | _IsexXsbp_~2 | _Isex_2 | (dropped) _Ibmi_who_1 | _Ibmi_who_2 | _Ibmi_who_3 | _IsexXbmi_~1 | _IsexXbmi_~2 | _IsexXbmi_~3 | _cons |

23 Homework: 1.10 The interaction _IsexXsbp_1_2 is the difference in coefficient to sbp_85 between the women and men. Lets consider the first BMI group (BMI on reference level): For men the line is as follows: logscl= *(sbp-85) For women the line is as follows: logscl=( )+( )*(sbp-85)

24 Homework: 1.10 The interaction _IsexXsbp_1_2 is the difference in coefficient to sbp_85 between the women and men. Lets consider the second BMI group : For men the line is as follows: logscl=( ) *(sbp-85) For women the line is as follows: logscl=( ) +( )*(sbp-85)

25 Homework: 1.11 The interaction coefficient _IsexXbmi_2_2 is the extra difference in level between overweight men and women compared to underweight men and women. testparm _IsexXbmi_* ( 1) _IsexXbmi_2_1 = 0 ( 2) _IsexXbmi_2_2 = 0 ( 3) _IsexXbmi_2_3 = 0 F( 3, 4648) = Prob > F =

26 Homework: 1.11 Lets consider the first bmi group: For men the level is as follows: logscl=5.28 For women the level is as follows: logscl= Then we look at the second bmi group: logscl= logscl=( )+( )

27 Homework: 1.7

28 Homework: 1.7


Download ppt "Eva Ørnbøl + Morten Frydenberg"

Similar presentations


Ads by Google