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?
Estimating the effects of a shockHi all. I am working on a research project to estimate the respective effects of divorce, jobloss a…
Time Fixed EffectsDear Stata users, For my analysis, I need to use time fixed effects on my panel data (Country-Year)…
Generate adjacency matrix in Mata and using it as input in StataDear all, I am using Stata 16 on Mac 10.14. I am currently working with two geocoded datasets. Data…
Please help: comparing three average treatment effects (ATE) coefficients to determine if they differ significantlyDear colleagues, I am running an average treatment effects analysis (teffects) for the binary outco…
one less class in latent class analysis with -gsem-Is there anybody who can explain why this 3-classes LCA model with -gsem- command gives me only two …
Subscribe to:
Post Comments (Atom)
0 Response to How to systematically erase the last character of a variable?
Post a Comment