Hello,
This is my first post, so please excuse me.
I have one variable with observations like this:
var1
^CTGO258068
^CTCH474369
^CTSY258074
^CTDG258075
^CTGC274785
^CTAC477646
BC477646
TC477646
And another variable like this:
var2
TM-FFHAPT
ORM-FFHAPT
VOX-FFHAPT
TOR
MOR
UPG-FFHAPT
1. How do I remove ^CT from var1 if they have ^CT as prefix and
2. How do I remove -FFHAPT from var2 if they have -FFHAPT at the end.
Many thanks,
Related Posts with Drop last 7 characters from obsrevations if they have certain characters
Creating first-order difference variables in repeated cross-sectional (i.e. pseudo panel) dataGreetings, I'm running Stata 15.1 on OSX. I've created a repeated cross-sectional dataset to assess…
One-sided test of coefficients obtained by mixedDear all, I ran mixed 'outcome' 'treatment' 'binary_covariates' 'metric_covaraites' [fweight=w] || b…
Quick questions about the interaction methodsDear Researchers, Greetings, I have quick questions about interaction variables, please. At first,…
Looping in Stata to extract values from one file to anotherHi all! So I am a bit stuck on something I have to do. 1. I have a dataset which is multi level, an…
No observations r(2000) with Regress and SEMHello all. I am working with a dataset that contains many categorical variables with values that are…
Subscribe to:
Post Comments (Atom)
0 Response to Drop last 7 characters from obsrevations if they have certain characters
Post a Comment