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
Population size smaller than number of observation, svysetDear Stata users, After applying svyset command to dataset with weights included in the dataset and…
How to use loops and macros to delete consecutive observations based on characteristics of the last observation in the group?Hey folks. I have choice data that has the following structure: Code: * Example generated by -data…
Multiple Correspondence Analysis in StataDear Stata users, Good morning. I have created a perception index using multiple correspondence an…
Why my loop codes failed? Code: xtset id week eststo: xtreg _contritotal afterblock age age2 if inrange(week, -4, 4) & we…
multivariate multiple random effects regressionsHey all, I am doing a research about the effect a dummy has on multiple dependent variables while a…
Subscribe to:
Post Comments (Atom)
0 Response to Problem with import delimited - characters "¿" "1/2" "1/4" etc
Post a Comment