I have a variable named S_Kx, S_Jx S_Yx, S_Sx
I want to nix all variables that dont' have the same beginning as they do with after _ (i.e. S_Sx would be kept, but S_Kx and all others would be dropped)
therefore
v_vx would be kept
!v_vx would be dropped
v can be ANY letter of the alphabet
how could I approach this?
Related Posts with Comparing string variable names
Counting unique no missing valuesHi! My dataset is about trust in government and media. It contains two variables: 1. city- the code …
Panel data: Calculate change within each subgroup from the first to the last observation (over time)Hi, I work on unbalanced panel data (26 states ("cant"), time period around 1970-2017) on wealth sh…
How to calculate effect size for Kruskal-Wallis test?Dear all, I am struggling to estimate the effect size for the Kruskal-Wallis test in Stata. I will b…
How to call the stored results in e()?I am using did_imputation and I read over the help file. I saw a part about the result regarding Sto…
forval with a variableHello everyone. I am new to Stata. I need your help for a short question. I have a dataset, and I ho…
Subscribe to:
Post Comments (Atom)
0 Response to Comparing string variable names
Post a Comment