I am running a regression for the returns of education on gross wage. The variables of interest are spread out among 4 different datasets therefore I had to merge all the datasets together by each wave. So merge dataset 1 through 4 for wave 1, wave 2, wave 3 each in a seprate stata file. I ended up with 7 waves each representing a different year. I then appended all the waves (which included all the variables I needed) together ending up with a single dataset with all the variables and with the 7 waves appended.
The variable names are different for each dataset (apart from the 2 id variables, obviously) but they are also different for each wave as well, for example for the year of birth for 2009, 2010 and 2011.
The ID variables are:
I tried running the regression for a random effects model separately for each year but I keep getting an insufficient observations error. Note that my data set does not have a year variable to group each wave since I have merged 4 data sets together therefore I have for each of the 4 data sets for each wave a year and month of fieldwork period variable:
where the 09 variables are for 2009 and the 10 variables are for 2010. (I have variables till 2016)
Is there anyway to run the regression using a random effects model and stop getting an observations error? Perhaps grouping the variables by year? And how is this possible?
Appreciate the help, thank you
The variable names are different for each dataset (apart from the 2 id variables, obviously) but they are also different for each wave as well, for example for the year of birth for 2009, 2010 and 2011.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input double(cw09b002 cw10c002 cw11d002) . . . . . . end
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input double(nomem_encr nohouse_encr) end
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input double(cw09b_m ch09c_m ci09b_m cf09b_m cw10c_m ch10d_m cf10c_m ci10c_m) end
Is there anyway to run the regression using a random effects model and stop getting an observations error? Perhaps grouping the variables by year? And how is this possible?
Appreciate the help, thank you
Comment