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 specify variable labels for the x-axis in several linesHello I would like to specify the variable names in several lines of a graph, because they are very …
Loop to copy all filesHi, i tried to do a loop to copy all my databases in the same file but i've got a problem. So i wan…
Bootstrapping timeHello I drew a SEM with SEM builder in STATA v.16. After that, I run Bootstrapping 5,000 but it too…
tobit with vce (cluster clustervar) or xttobitDear all, I'm working with a unbalanced panel data set with 208500 observations from 3371 firms in …
Referring to dates using business calendarsDear Stata list, I am using time series data with a business calendar as I only look at trading dat…
Subscribe to:
Post Comments (Atom)
0 Response to invalid 'h' r(198) error in foreach loop
Post a Comment