Hello,
I have a longitudinal dataset with 5 waves. I used the command xtdescribe and I found out that have a total of 66689 individuals. Then I tried to find the number of individuals by sex (xtdescribe if sex==1 and xtdescribe if sex==2) .
the results were that I have a total of 31341 males and 35381 females. When I add these values the result was 66723 (and not 66689). I inspect the variable sex and I only have two missing observations. Can you please help me with an explanation for this? I send an example of the dataset below. Thank you very much in advance.
* Example generated by -dataex-. For more info, type help dataex
clear
input long(pidp pid) byte sex
22445 10127798 2
22445 10127798 2
22445 10127798 2
22445 10127798 2
29925 10192697 2
29925 10192697 2
29925 10192697 2
76165 10689869 2
76165 10689869 2
76165 10689869 2
223725 11926929 1
280165 12430439 2
280165 12430439 2
280165 12430439 2
280165 12430439 2
280165 12430439 2
333205 12908843 2
333205 12908843 2
333205 12908843 2
387605 13361163 2
387605 13361163 2
469205 13857142 2
469205 13857142 2
541285 14396769 1
541285 14396769 1
541965 14396793 2
599765 14757249 2
599765 14757249 2
599765 14757249 2
665045 15270041 1
665045 15270041 1
665045 15270041 1
732365 15752658 1
732365 15752658 1
760925 16095227 1
813285 16441141 1
813285 16441141 1
850005 16714296 1
956765 17401356 1
987365 17624592 2
1558565 36791768 2
1587125 17870879 2
1587125 17870879 2
1587125 17870879 2
1697285 42526507 1
1731965 45754268 1
1833965 50832336 1
1833965 50832336 1
1833965 50832336 1
1833965 50832336 1
2067205 65313828 1
2270525 76446336 2
2270525 76446336 2
2292285 77065891 1
2297045 77185978 1
2626845 93565895 1
2670365 94533008 2
2853965 96577029 2
2853965 96577029 2
2853965 96577029 2
2888645 96949503 2
2888645 96949503 2
2932845 97515191 1
3229325 106197851 2
3424485 113800185 2
3565925 118692798 2
3568645 118692895 1
3587685 118781707 1
3587685 118781707 1
3663845 119065835 1
3663845 119065835 1
3663845 119065835 1
3667245 119074613 2
3667245 119074613 2
3667245 119074613 2
3667245 119074613 2
3705325 119277506 2
3705325 119277506 2
3705325 119277506 2
3705325 119277506 2
3705325 119277506 2
3914085 127440488 2
3914765 127440518 1
3915445 127440534 2
3916125 127440569 2
4091565 135447429 1
4091565 135447429 1
4091565 135447429 1
4192205 141158735 2
4454005 154358304 1
4454005 154358304 1
4454005 154358304 1
4454005 154358304 1
4454005 154358304 1
4473725 154588539 1
4473725 154588539 1
4473725 154588539 1
4562125 159615704 1
4626045 164246088 1
4626045 164246088 1
end
label values pid pid
label values sex c_sex
label def c_sex 1 "male", modify
label def c_sex 2 "female", modify
[/CODE]
I have a longitudinal dataset with 5 waves. I used the command xtdescribe and I found out that have a total of 66689 individuals. Then I tried to find the number of individuals by sex (xtdescribe if sex==1 and xtdescribe if sex==2) .
the results were that I have a total of 31341 males and 35381 females. When I add these values the result was 66723 (and not 66689). I inspect the variable sex and I only have two missing observations. Can you please help me with an explanation for this? I send an example of the dataset below. Thank you very much in advance.
* Example generated by -dataex-. For more info, type help dataex
clear
input long(pidp pid) byte sex
22445 10127798 2
22445 10127798 2
22445 10127798 2
22445 10127798 2
29925 10192697 2
29925 10192697 2
29925 10192697 2
76165 10689869 2
76165 10689869 2
76165 10689869 2
223725 11926929 1
280165 12430439 2
280165 12430439 2
280165 12430439 2
280165 12430439 2
280165 12430439 2
333205 12908843 2
333205 12908843 2
333205 12908843 2
387605 13361163 2
387605 13361163 2
469205 13857142 2
469205 13857142 2
541285 14396769 1
541285 14396769 1
541965 14396793 2
599765 14757249 2
599765 14757249 2
599765 14757249 2
665045 15270041 1
665045 15270041 1
665045 15270041 1
732365 15752658 1
732365 15752658 1
760925 16095227 1
813285 16441141 1
813285 16441141 1
850005 16714296 1
956765 17401356 1
987365 17624592 2
1558565 36791768 2
1587125 17870879 2
1587125 17870879 2
1587125 17870879 2
1697285 42526507 1
1731965 45754268 1
1833965 50832336 1
1833965 50832336 1
1833965 50832336 1
1833965 50832336 1
2067205 65313828 1
2270525 76446336 2
2270525 76446336 2
2292285 77065891 1
2297045 77185978 1
2626845 93565895 1
2670365 94533008 2
2853965 96577029 2
2853965 96577029 2
2853965 96577029 2
2888645 96949503 2
2888645 96949503 2
2932845 97515191 1
3229325 106197851 2
3424485 113800185 2
3565925 118692798 2
3568645 118692895 1
3587685 118781707 1
3587685 118781707 1
3663845 119065835 1
3663845 119065835 1
3663845 119065835 1
3667245 119074613 2
3667245 119074613 2
3667245 119074613 2
3667245 119074613 2
3705325 119277506 2
3705325 119277506 2
3705325 119277506 2
3705325 119277506 2
3705325 119277506 2
3914085 127440488 2
3914765 127440518 1
3915445 127440534 2
3916125 127440569 2
4091565 135447429 1
4091565 135447429 1
4091565 135447429 1
4192205 141158735 2
4454005 154358304 1
4454005 154358304 1
4454005 154358304 1
4454005 154358304 1
4454005 154358304 1
4473725 154588539 1
4473725 154588539 1
4473725 154588539 1
4562125 159615704 1
4626045 164246088 1
4626045 164246088 1
end
label values pid pid
label values sex c_sex
label def c_sex 1 "male", modify
label def c_sex 2 "female", modify
[/CODE]
Comment