Hi,
I am using panel data with rounds in 2004-05 and 2011-12. IDPERSON is the id variable. However, when I specify xtset using the IDPERSON and SURVEY (time-variable), I get a weakly balanced panel and I believe it is causing this error.
The xtdescribe output shows that IDPERSON and SURVEY uniquely identify each observation.
IDPERSON: 1.020e+09, 1.020e+09, ..., 3.402e+11 n = 50958
SURVEY: 0, 1, ..., 1 T = 2
Delta(SURVEY) = 1 unit
Span(SURVEY) = 2 periods
(IDPERSON*SURVEY uniquely identifies each observation)
Distribution of T_i: min 5% 25% 50% 75% 95% max
1 1 1 1 1 1 1
Freq. Percent Cum. | Pattern
---------------------------+---------
25479 50.00 50.00 | .1
25479 50.00 100.00 | 1.
---------------------------+---------
50958 100.00 | XX
Based on similar statalist threads, I tried using: egen id = group(IDPERSON). However, it failed to work as well. I have attached a sample of the dataset using dataex.
My regressions are:
xtreg fertility_decision paid_work_status age SURVEY i.SURVEY##age, re
xtreg fertility_decision paid_work_status age SURVEY i.SURVEY##age, fe
I am using panel data with rounds in 2004-05 and 2011-12. IDPERSON is the id variable. However, when I specify xtset using the IDPERSON and SURVEY (time-variable), I get a weakly balanced panel and I believe it is causing this error.
The xtdescribe output shows that IDPERSON and SURVEY uniquely identify each observation.
IDPERSON: 1.020e+09, 1.020e+09, ..., 3.402e+11 n = 50958
SURVEY: 0, 1, ..., 1 T = 2
Delta(SURVEY) = 1 unit
Span(SURVEY) = 2 periods
(IDPERSON*SURVEY uniquely identifies each observation)
Distribution of T_i: min 5% 25% 50% 75% 95% max
1 1 1 1 1 1 1
Freq. Percent Cum. | Pattern
---------------------------+---------
25479 50.00 50.00 | .1
25479 50.00 100.00 | 1.
---------------------------+---------
50958 100.00 | XX
Based on similar statalist threads, I tried using: egen id = group(IDPERSON). However, it failed to work as well. I have attached a sample of the dataset using dataex.
My regressions are:
xtreg fertility_decision paid_work_status age SURVEY i.SURVEY##age, re
xtreg fertility_decision paid_work_status age SURVEY i.SURVEY##age, fe
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input int SURVEY double IDPERSON int(fertility_decision paid_work_status age) 0 1020101002 1 0 45 0 1020102009 1 0 26 0 1020103002 0 0 36 0 1020104002 1 0 40 0 1020105003 1 0 28 0 1020107002 1 0 40 0 1020108002 1 0 30 0 1020109002 1 0 41 0 1020110007 0 0 38 0 1020112002 1 1 26 0 1020113002 1 0 36 0 1020114002 0 0 32 0 1020116004 1 0 28 0 1020117001 1 0 36 0 1020118005 1 0 29 0 1020119002 1 0 28 0 1020120004 0 0 35 0 1020201002 1 0 34 0 1020202002 0 0 44 0 1020203002 1 0 26 0 1020204002 1 0 34 0 1020206004 1 0 40 0 1020207004 1 0 22 0 1020210002 0 0 32 0 1020211002 1 0 46 0 1020214002 1 0 35 0 1020215002 1 0 33 0 1020216002 1 0 42 0 1020217002 1 0 29 0 1020218002 1 0 30 0 1020219002 1 0 36 0 1020220002 1 0 39 0 1020302002 1 0 48 0 1020305002 1 0 41 0 1020306009 1 0 28 0 1020307002 1 0 42 0 1020309001 1 0 49 0 1020310004 1 0 25 0 1020311002 1 0 47 0 1020312002 1 0 42 0 1020313003 1 0 34 0 1020314004 1 0 21 0 1020315003 1 0 26 0 1020316002 1 0 40 0 1020317002 1 0 48 0 1020319004 1 0 39 0 1020401002 0 0 37 0 1020404002 1 0 35 0 1020406002 1 0 40 0 1020407002 1 0 45 0 1020408004 0 0 32 0 1020409002 1 0 38 0 1020412002 1 0 49 0 1020413017 1 0 40 0 1020415002 1 0 37 0 1020417011 0 0 29 0 1020420002 1 0 29 0 1020501002 1 0 25 0 1020502002 1 0 45 0 1020504004 0 0 37 0 1020507004 1 0 43 0 1020509002 1 0 45 0 1020511002 1 0 30 0 1020512003 1 0 29 0 1020513002 1 1 38 0 1020515002 1 0 36 0 1020516002 1 0 43 0 1020517002 1 0 36 0 1020518002 1 0 32 0 1020519002 1 0 44 0 1020520004 0 0 30 0 1020601002 1 1 40 0 1020602002 0 0 47 0 1020603002 1 0 40 0 1020604002 1 0 28 0 1020606002 1 0 38 0 1020607002 1 0 30 0 1020608002 1 0 36 0 1020609002 1 0 27 0 1020610002 1 1 43 0 1020611002 0 0 38 0 1020612004 0 0 30 0 1020614002 1 0 34 0 1020615004 0 0 26 0 1020701002 0 0 40 0 1020702002 1 0 42 0 1020703002 1 1 23 0 1020704002 0 0 48 0 1020705002 0 0 42 0 1020706004 1 0 35 0 1020707002 1 0 35 0 1020708002 0 0 35 0 1020710002 1 0 25 0 1020711002 0 0 38 0 1020712002 1 0 30 0 1020715002 1 0 48 0 1020803003 0 0 16 0 1020804001 0 1 37 0 1020805002 1 0 45 0 1020806002 0 1 30 end label values SURVEY SURVEY_LABEL label def SURVEY_LABEL 0 "IHDS 1", modify label values fertility_decision GR3A label def GR3A 0 "No 0", modify label def GR3A 1 "Yes 1", modify label values paid_work_status WS2Y label def WS2Y 0 "No 0", modify label def WS2Y 1 "Yes 1", modify

Comment