[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: understanding xi command

From   julio caceres delpiano <>
To   <>
Subject   st: understanding xi command
Date   Wed, 6 Feb 2008 01:17:51 +0100

Hi all,

I am studying the relationship between two variables, y and x. I have
observations for 10 years, 51 states and 10 age groups. In my model I wanted
to introduce fixed effect by year, state and year-state interaction.

I run the following regression

xi:reg y x i.state i.year i.year*i.state
(then the identification comes from the variation across age groups)

When I run this regression I am getting results that I am not buying. In
order to check my results and given the fact that I am not interested in the
coefficients of the dummies, I tried to construct manually the fixed

I started with the model,
xi:reg y x i.state,

which it should be equivalent to the model,

reg dy_s dx_s, with

dy_s=y-my ;  dx_s=x-mx; and mx=mean(x) by state

I run this two specifications and I am getting the same coefficients as I

I do the same for the model

xi:reg y x i.state i.year

which is equivalent to the model,

reg dy_sy dx_sy, with

dy_sy= dy_s - mdy_sy ;  dx_sy= dx_s-mdx_sy; and mdx_sy=mean(dx_s) by year

and I getting the same results with both specifications. My problem comes
when I tried to replicate the model

xi:reg y x i.state i.year i.year*i.state

because by doing the triple d_mean, I get different results that are
different to the one that stata provides.

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index