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?
Creating a variable that corresponds the proportion of observations that the current observation is larger thanHi, I am looking to create a variable that corresponds to the proportion (or percentage) of observat…
Solving Endogeneity in Panel Data Analysis: (R coding)Hi, I need your help in my regression model: I have a panel data for 6 year at state level (50 state…
Using Classes from LCA in another modelDear Statalisters, I am using Stata17. I have run the following LCA model (the analysis try to grou…
Test for collinearityHi all, I'm trying to estimate the Wald-DID below: Code: svy: ivregress 2sls OUTCOMEVAR i.time…
STATS CANADA: hadamard? brr? what am I doingI am using the National Longitudinal Survey of Children and Youth (NLSCY) Cycle 1 from Statistics Ca…
Subscribe to:
Post Comments (Atom)
0 Response to Can someone tell me why the variable 'id' can't be found please?
Post a Comment