Dear all,
I'm working with a dataset with 24 different data waves. Not all individuals have information from all waves. If an individual have been registered in a data wave, there is information about 'year of birth'. Unfortunately is' year of birth' not consistent across datawaves. I have 2,041 individuals with more than 3 years between the the lowest and highest 'year of birth' reported.
I have calculated rowmax, rowmedian and rowmin. But have to I find the year of birth reported most often? I have tried to use the the mode command under egen, but I think mode is for column and not row?
To clarify the data example below: 'birthyear1983' means 'year of birth' reported in 1983 data wave.
Also, I could not make an example with all waves, so I hope the example still makes sense.
Kind regards
Jannie
. dataex birthyear1983 birthyear1984 birthyear1985 birthyear1986 birthyear1987 birthyear2013 birthyear2015 Yearborn_min Yearborn_max Yearborn_median if yearbirth_dif>=3 & Year_born<.
[CODE]
* Example generated by -dataex-. To install: ssc install dataex
clear
input float(birthyear1983 birthyear1984 birthyear1985 birthyear1986 birthyear1987 birthyear2013 birthyear2015 Yearborn_min Yearborn_max Yearborn_median)
1953 1953 1953 1953 1953 1953 . 1933 1953 1953
1961 1960 1960 1960 1960 1960 1960 1960 1966 1960
1971 1971 1971 1971 1971 1971 1971 1965 1971 1971
1918 1918 1918 1918 1918 1918 1918 1915 1918 1918
1966 1966 1966 1966 1966 . 1966 1950 1966 1966
1980 1980 1980 1980 1950 1980 1980 1950 1980 1980
1933 1933 1933 1930 1933 1933 1933 1930 1933 1933
1931 1934 . . . . . 1931 1934 1932.5
1932 1932 1932 1937 1932 1932 1932 1932 1937 1932
1950 1950 1950 1950 1950 1950 1950 1950 1969 1950
1910 1910 1910 1910 1910 . . 1910 1970 1910
1975 1975 1975 1975 1975 1975 . 1970 1975 1975
1973 1973 1973 1976 1973 1973 1973 1973 1976 1973
1970 1970 1970 1970 1970 1970 1970 1970 1974 1970
. . . 1966 1966 . . 1956 1966 1966
1960 1950 . . . . . 1950 1960 1955
1966 1966 1966 1966 1966 1966 1966 1966 1969 1966
--more--
Related Posts with Different values (year of birth reported for the same individual - can Stata pick the value occuring most frequently (mode)
Clever appendHi Statalisters, hope to find you all well. So, the problem is the following. I have two large pan…
calculating a formula in stataHello everyone I have a sample of 100 rnormal() in stata, am going to calculate this formula in stat…
Removing duplicate matchesHi, I have used vmatch to match my control group to my treatment group based on two characteristics…
Stone geometric price index in stataHi Statalists, Does anyone know how to compute the Stone geometric price index in stata? …
Bootstraping after "mi estimate, cmdok: sureg"Hi Statalist, I would like to test the significance of the indirect effect of multiple mediators. T…
Subscribe to:
Post Comments (Atom)
0 Response to Different values (year of birth reported for the same individual - can Stata pick the value occuring most frequently (mode)
Post a Comment