Stata program for generating data

clear input y x1 x2 cnt 0 0 0 10 0 1 0 10 1 0 0 10 1 1 0 20 0 0 1 5 0 1 1 5 1 0 1 20 1 1 1 320 end expand cnt generate x12 = x1*x2

Results of analyzing data with **regress**, **logit** and **logistic**
commands.

Logistic with Logits |
Logistic with Odds Ratios |
||

Stata Command for analysis |
. regress y x1 x2 x12 adjust , by(x1 x2) |
. logit y x1 x2 x12 adjust , by(x1 x2) |
. logistic y x1 x2 x12 adjust , by(x1 x2) exp |

Regression Results |
x1 .166 x2 .3 x12 .018 _cons .5 |
x1 .693 x2 1.386 x12 2.079 _cons 0.0 |
x1 2 x2 4 x12 8 |

Predicted Values by x1 and x2. |
| x2 x1 | 0 1 ---+---------- 0 | .5 .8 1 | .666 .984 |
| x2 x1 | 0 1 ----+----------- 0 | 0 1.386 1 | .693 4.158 |
| x2 x1 | 0 1 ----+----------- 0 | 1 4 1 | 2 64 |

Interpretation of coefficient for X1 |
The difference between .666 and .5
= .166, (the effect of x1 when x2 is 0). |
The difference between .693 and
0 = .693, (the effect of x1 when x2 is 0). |
The ratio of 2 / 1, (the effect of
x1 when x2 is 0). |

Interpretation of coefficient for X2 |
The difference between .8 and .5
= .3, (the effect of x2 when x1 is 0). |
The difference between
1.386 and 0 = 1.386, (the effect of x2 when x1 is 0). |
The ratio of 4 / 1, (the effect of
x2 when x1 is 0). |

Interpretation of coefficient for X12 |
The difference between (.984 – .8) and (.666 –
5) = .018, (the effect of x1 when x2=1 minus the effect of x1 when x2=0). |
The difference between (4.15 – 1.38)
and (.693 – 0) = 2.077, (the effect of x1 when x2=1 minus the effect of x1 when
x2=0). |
The ratio of (64 / 4) divided
by ( 2 / 1), (the effect of x1 when x2=1 divided by the effect of
x1 when x2=0). |

Notes on interpretation |
Note that the interpretation of the results is identical to . The only difference is the predicted value is a "Logit", but the relationship between the coefficients and the predicted values is the same as with . | The interpretation of the results
similar to and Logits, except that the coefficients in and Logits
reflect the differences in predicted values, the Odds Ratios
reflect the ratios of the predicted values. |