I have a dataset that has data that is pooled across different years.
At the moment, I would to like be able to identify the occupational codes which are common across two years (e.g. 2004 and 2005).
So for example, say in the year 2004 the following occupational codes are present:
0101
0102
0103
0104
0105
And in the year 2005, the following occupational codes are present:
0101
0102
1111
1112
1113
Is there a command/function in Stata which can tell me that only occupational codes "0101" and "0102" are present in both? Note that I can't use merge as I'm not using two different .DTA files - it's within the dataset.
Thanks
Related Posts with Identifying differences in a variable within a dataset
Training sample for lasso and them making out of sample predictionsDear All I have created a loop to generate forecasts using a lasso regressions that (I hope) are co…
Unbiased 95% CI of an x variable in y units after gsem ln(y)Charles Huber discusses the interpretation of models with log-transformed outcomes in Stata News 34-…
Estimating the Effect of a given variable on mortality ratesHi everyone, Below is an example from my dataset. datediag dead dateexit id perdiag agegrp 4429 1 …
Tip with recoding 40+ values in a variableHi! I am new to STATA and I am trying to recode a variable with 40 values. For values 1 to 38, i wan…
Change in probablity of being downgraded as the explanatory variable change from the bottom (30%) to the top (30%) of the sampleDear all, I am sorry to bother you. I was wondering how one could calculate the change in probablit…
Subscribe to:
Post Comments (Atom)
0 Response to Identifying differences in a variable within a dataset
Post a Comment