sum HH1 HH2 LN // HH1=cluster number, HH2=household number, LN=line number (child in household)
gen idnumber = string(HH1) + " " + string(HH2) + " " + string(LN)
gen id = string(HH1) + " " + string(HH2) // use this to merge with hh data below
save ch.dta, replace // this will save to current working directory
use "/Users/justinegosling/Desktop/Malawi_MICS5_Datasets/Malawi MICS 2013-14 SPSS Datasets/House hold.dta"
// 28479 observations, 177 variables
// this also has the same HH1 HH2 variables:
sum HH1 HH2
gen id = string(HH1) + " " + string(HH2) // to merge on household id with child data
merge 1:m id using "/Users/justinegosling/Desktop/Malawi_MICS5_Datasets/Malawi MICS 2013-14 SPSS Datasets/childrens .dta"
Can someone please tell me why after the above coding when I try to merge the data states response is: variable id not found r(111);
Many thanks
Related Posts with Can someone tell me why the variable 'id' can't be found please?
Unlimited loop of events tested when using eventstudy2Hello! I am currently conducting my final thesis and for that I am using the package eventstudy2, a…
Referring to a certain value when generating a new variableHello, I want to refer to a certain value when generating a new variable. My panel dataset looks a…
Request syntax assistance with v17 [table] command to get table of frequency in descending frequency orderI apologize for even asking, assuming there is something very simple I simply cannot find. As [tabl…
what should we do if after first differences the non-stationary of panel data still remained?hello everyone, I use a panel data and do after running the regression I get the residual and to fol…
Rearranging individual dates within a varlistHi, I'm extremely new to Stata (5 weeks) and am stuck with something my lecturer has asked us to do.…
Subscribe to:
Post Comments (Atom)
0 Response to Can someone tell me why the variable 'id' can't be found please?
Post a Comment