This is my first post on here, my apologies for any errors.

My data is organized by State and Year. There are hundreds of observations per State-Year that have been used to calculate a new variable x that is the same value for every observation within the state-year group. I just want a simple table that lists the first observation of X in each state-year group (or just the value of X for each state year group). The final table might look something like:

State Year X
AL 1980 ##
AL 1982 ##
.
.
WY 1980 ##
WY 1982 ##

I know this should be an easy fix, but I haven't been able to figure it out. The closest I can get gives me error messages about mixing 'by' and 'in' commands.

Using:
by State Year: list X

Gives me every the value of X for observation with the state-year...and all the values of X are the same within that state-year group.

-Will