Dear members,

I am a student new to STATA and may need your help on the below question.

I have the level regression as below:

π’ππ‘=ππ‘ + πΏπ + Ξ£π‘β₯1400πΌπ‘

(u is log(population); WE is dummy variable if the city is in Western Europe; PAT is dummy variable if the city is involved in Atlantic trade; ππ‘ denotes time effects and πΏπ denotes city effects)

and I am looking to transfer this to first difference regression, I wrote the equation as below (not sure if this is correct)

π’ππ‘ βπ’ππ‘β1 =β³ππ‘ +πΌπ‘

And I tried to estimate the difference regression, and I thought that the point estimates of coefficients should be the same as those in the level regression.

I used the code:

gen yearn = 1 if year == 1300

replace yearn = 2 if year == 1400

replace yearn = 3 if year == 1500

replace yearn = 4 if year == 1600

replace yearn = 5 if year == 1700

replace yearn = 6 if year == 1750

replace yearn = 7 if year == 1800

replace yearn = 8 if year == 1850

bysort city: gen du=u-u[yearn-1]

gen du1 = du if year == 1850

reg du1 WE_y8 PAT_y8

However, when I compared the coefficients with those in level regression they are not the same. Please give me some advices on my equation and estimates.

The data sample are below

Thank you very much !!!

I am a student new to STATA and may need your help on the below question.

I have the level regression as below:

π’ππ‘=ππ‘ + πΏπ + Ξ£π‘β₯1400πΌπ‘

*WE*π ππ‘ + Ξ£π‘β₯1400π½π‘ ππ΄ππ ππ‘ +πππ‘(u is log(population); WE is dummy variable if the city is in Western Europe; PAT is dummy variable if the city is involved in Atlantic trade; ππ‘ denotes time effects and πΏπ denotes city effects)

and I am looking to transfer this to first difference regression, I wrote the equation as below (not sure if this is correct)

π’ππ‘ βπ’ππ‘β1 =β³ππ‘ +πΌπ‘

*WE*π ππ‘ + π½π‘ ππ΄ππ ππ‘ +πππ‘And I tried to estimate the difference regression, and I thought that the point estimates of coefficients should be the same as those in the level regression.

I used the code:

gen yearn = 1 if year == 1300

replace yearn = 2 if year == 1400

replace yearn = 3 if year == 1500

replace yearn = 4 if year == 1600

replace yearn = 5 if year == 1700

replace yearn = 6 if year == 1750

replace yearn = 7 if year == 1800

replace yearn = 8 if year == 1850

bysort city: gen du=u-u[yearn-1]

gen du1 = du if year == 1850

reg du1 WE_y8 PAT_y8

However, when I compared the coefficients with those in level regression they are not the same. Please give me some advices on my equation and estimates.

The data sample are below

city | year | PAT | u | WE |

aachen | 1300 | 0 | 3.044523 | 1 |

aachen | 1400 | 0 | 2.302585 | 1 |

aachen | 1500 | 0 | 2.890372 | 1 |

aachen | 1600 | 0 | 3.135494 | 1 |

aachen | 1700 | 0 | 2.70805 | 1 |

aachen | 1750 | 0 | 3.178054 | 1 |

aachen | 1800 | 0 | 3.178054 | 1 |

aachen | 1850 | 0 | 3.951244 | 1 |

aalst | 1300 | 0 | 1.386294 | 1 |

aalst | 1400 | 0 | 1.386294 | 1 |

aalst | 1500 | 0 | 1.609438 | 1 |

aalst | 1600 | 0 | 1.94591 | 1 |

aalst | 1700 | 0 | 2.079442 | 1 |

aalst | 1750 | 0 | 2.079442 | 1 |

aalst | 1800 | 0 | 2.397895 | 1 |

aalst | 1850 | 0 | 2.833213 | 1 |

amsterdam | 1300 | 1 | 0 | 1 |

amsterdam | 1400 | 1 | 1.098612 | 1 |

amsterdam | 1500 | 1 | 2.70805 | 1 |

amsterdam | 1600 | 1 | 3.988984 | 1 |

amsterdam | 1700 | 1 | 5.298317 | 1 |

amsterdam | 1750 | 1 | 5.347107 | 1 |

amsterdam | 1800 | 1 | 5.379897 | 1 |

amsterdam | 1850 | 1 | 5.416101 | 1 |

athens | 1300 | 0 | 3.218876 | 0 |

athens | 1400 | 0 | 3.555348 | 0 |

athens | 1500 | 0 | 2.302585 | 0 |

athens | 1600 | 0 | 3.496508 | 0 |

athens | 1700 | 0 | 2.564949 | 0 |

athens | 1750 | 0 | 2.302585 | 0 |

athens | 1800 | 0 | 2.484907 | 0 |

athens | 1850 | 0 | 3.401197 | 0 |