I am working with 2 data sets that contain information about thousands of schools, and in order to match them I am going to use the school code given by the government. The problem is that in one data set the code has 10 characters each, whereas in the other it consists of 11, I have already checked that the schools are the same, it is just that one extra character, how can I erase that extra character from every school code? I am thinking of using a loop, for example: foreach var of school_code {
But then I do not know how to tell stata to erase the last character from every school code. Can you help me?
Related Posts with How to systematically erase the last character of a variable?
Export cross tabulation table to excel using stataHello folks, this may be a dumb question, but how can i get a cross tabulation output export to exce…
margins not estimableHello, I am trying to have the partial effect of being an immigrant evaluated at the mean level of y…
correlation across error terms in nlsurHi all, I am unsure on how to impose the correlation across the error terms in nlsur. Thanks in adv…
Syntax for FMM Regression for Multiple Observations Within CasesI need to estimate a 3-latent-class FMM regression (with a continous dependent variable) analyzing a…
How to reshape data for analysis (Discrete choice experiment)Hi there, hello to the community. I'd need some help with how to prepare/shape data for analysis fro…
Subscribe to:
Post Comments (Atom)
0 Response to How to systematically erase the last character of a variable?
Post a Comment