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
Model with Independent lagged variables: FE, RE or POLS?Dear all, i am running a regression using panel data and looking at the effect of company financial…
Speed: Report margins dydx(*) at means with panel clogitHi there, I am trying to report the margins at means for a FE logit (clogit) model. When I type "ma…
How to go from a string variable to date, and a specific duplicateHello, I have two problems. THe first problem is with the date variable below. this is a string var…
Complicated vlookup-like functionA simplified database of time use data is below. T1-T5 are time periods (e.g. T1 is 1pm - 2pm; T2 is…
stset for multiple failure data queryDear all, I would like to ask for some advice on 'stset'-ing my dataset with multiple failures per …
Subscribe to:
Post Comments (Atom)
0 Response to Generate a new variables, with the last two numbers of another variable
Post a Comment