Hi everyone,
I want to import a public data set of standardized tests in Colombia. This information is available as a text file. I tried importing it with the import delimited command, but I encounter problems as some contents of the variables are characters such as "¿" and "1/2". This makes stata divide the values between two variables, creating an non existing variable and moving all contents of the following variables.
My code is:
forvalues x=2009/2019 {
forvalues y=1/2 {
clear
import delimited "${raw_dir}/SB11_`x'`y'/SB11_`x'`y'.txt", ///
delimiter("¬Â") varnames(1)
dropmiss, force // This is to try to solve the problem but doesn't quite work out
cap rename ïestu_exam_nombreexamen estu_exam_nombreexamen
save "${use_dir}/original/S11_`x'`y'.dta", replace
}
}
Thabk you very much for your help!
Related Posts with Problem with import delimited - characters "¿" "1/2" "1/4" etc
Bruteforcing regressionsFrom a set of about 300 variables, I've pared down to about 30 potential x variables. Assuming a lin…
Adding region fixed effects in ordered-probit estimation in a cross-section analysisMy dependent variable can take 3 distinct values so I am leaning towards using ordered-probit estima…
How copy graphs to word? I see the button for "copy" the graph but could not paste it to word.I see the button for "copy" the graph but could not paste it to word since "paste" button in word is…
Comparing a variable acorss many categoriesI want to test that a variable does not differ by group. I get how to do it between two groups but n…
Copy over variable labels when standardizingI have a dataset with over 300 variables and 80000 observations. A bunch of the variables are on sca…
Subscribe to:
Post Comments (Atom)
0 Response to Problem with import delimited - characters "¿" "1/2" "1/4" etc
Post a Comment