Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: comparing variables across time

From   Navid Asgari <>
To   "''" <>
Subject   st: comparing variables across time
Date   Mon, 30 Apr 2012 17:15:22 +0800


I am new to the list server, though have been using Stata for the last couple of years. So, please forgive me if I am not following any of your conventions in asking a question.

I want to do a pair wise comparison of several variables across different years. I would like to know how many new characters under P1 and P2 (together)exists in year 1996 that did not exists in year 1995.

 The dataset looks like this:

  Year      P1     P2
--------  ------- ------
1995        A       B
1995        A       C	
1995        D       A
1995        E       A
1996        B       A				
1996        A       M		
1996        A	  H
1996	      A       C	  

So the code should show "2", since character M and H exist under P1 and P2 in the year 1996, but not in 1995.

Thanks in advance,

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index