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?
Help with a graph bar Goo morning, I did this bar graph, but now I need the dark blue line to be a point and not a bar. …
Declaring datetime data before 1900I imported my monthly time series data from 1824-1940 from excel to Stata. The time variable is in s…
Fixed CovariatesHi, I am an undergraduate student attempting repeat measure multilevel modelling for my dissertation…
File icons not showing after re-installing StataI have recently re-installed my Stata 15 version in the same computer. I took care to uninstall it …
Adopting bayes:mlogit when there is underlying latent variableDear statalist, I have been working on polytomous nominal responses with underlying latent variable …
Subscribe to:
Post Comments (Atom)
0 Response to Can someone tell me why the variable 'id' can't be found please?
Post a Comment