Dear statalists,
I am currently working to extract specific variables from the British Househould Panel Survey (BHPS) to create a personalised dataset. Following the guidelines in an online manual (https://www.understandingsociety.ac....ta-version.pdf), I run the following code:
foreach w in h i j k l m n o p q r {
use `w'j1cssf `w'hid `w'j1rgsc `w'j1sec `w'j1seg `w'j1soc_cc `w'j1none using `w'indresp, clear
renpfix `w'
gen wave = strpos("abcdefghijklmnopqr","`w'")
sort hid
save $dir3/wavehon`w', replace
}
STATA produced the following output:
invalid 'h'
r(198);
I can't quite figure out what the problem is, as I don't think I specified a variable called "h" in my code.
Thank you very much in advance to anyone who will spend their time answering my question!
Related Posts with invalid 'h' r(198) error in foreach loop
How to correlate inflation and employment?Hi I'm working on my thesis and I'm using inflation and its effects on MSMEs. I have a small sample …
Reassign variable valuesI would like to record the responses of the adult females (n_female) in the household in sequence i.…
Weakly balanced Panel Data SetHi Statalisters, I am a novice user in Stata and it's my first post. I'm working with Stata.14 and …
xtcloglog population averaged vs. random effectsHi Statalist, I would like to estimate a complementary loglog model with induvidual effects using S…
mixed not concaveIn order to replicate the problem of not concave, the data is uploaded:https://www.dropbox.com/s/k45…
Subscribe to:
Post Comments (Atom)
0 Response to invalid 'h' r(198) error in foreach loop
Post a Comment