Hey everyone,
I have a string variable 'p2' that consists of ID codes formatted as follows "BBSC0123" "BBSC01010", I am trying to remove the 0 directly following the letters, but not remove any 0 that might be in the last 4 digits of the code?
I am relatively new to stata and have tried:
. gen p4 = substr(p2, 6, 4)
and
. gen p4 = substr(p2, 1, 4)
(only want to keep the 1-4 and 6-9 digits?) But can't workout how to do one that keeps either side of the 0
Related Posts with Removing the intermediate 0 from string variable
How to deal with December/January issues when using mkdir to create directories from system datesHello all, Using Stata 15.1/IC I've been using a do file for the past 8 months or so that automati…
ARIMA and SPSSWe are discontinuing use of SPSS (a product I have never used) in our office and one of my colleague…
F statistic from logit model with survey dataHi, when performing logistic regression with survey data, is the reported F statistic actually resu…
Which test? Values differ from zero significantly?Dear all, how I can check that the following values differ from zero significantly? 0 = expected v…
Computing effect size after weighted multiple regressionHi all, I have another question about effect size after weighted multiple regression. the estat esi…
Subscribe to:
Post Comments (Atom)
0 Response to Removing the intermediate 0 from string variable
Post a Comment