Hi there,
In my databank, I have a variable that tells me about a departure time (the variable is named hredep). The data is written like this: hhmm [h for hour, m for minutes).
So, for a departure time of 14:45, my data given in hredep is 1445.
I need to create a new variable that separate the last two digits, so I could obtain only the minutes. So in my exemple above I would have the data 45.
How can i do this? And what if I want the hour, so the first the numbers instead?
Thank you very much!
Maxime
Related Posts with Generate a new variables, with the last two numbers of another variable
p-values from mtest(holm) and mtest(noadjust)? Do we compare the adjusted P values directly with conventional significance levels?Hi all I run a nonlinear sur using "nlsur" I then run a test on nearly 8 nonlinear restrictions on t…
Multiple Imputation and mi stset for Cox RegressionDear Stata List I have a good sized data set ( >6000 records) of health data. In this data set I…
network meta-analysis and the adjusting variance approach for within‐person trialsHi, I have just started to perform a network meta-analysis in stata and I want to know if it is poss…
How to separate an observation entered within an observation and use some of the contentHello, I have a dataset that is collected at village (group) level with randomly selected household…
Merging Data with mismatch in Variable NamesI currently have two datasets, This is the first one:- input str6 State str3 Statepost byte Year do…
Subscribe to:
Post Comments (Atom)
0 Response to Generate a new variables, with the last two numbers of another variable
Post a Comment