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
Marginal effects of binary explanatory variable after craggitDear Statalist, Greetings! I was trying to estimate the drivers of farmers adoption decions. My dep…
T-Test with Multi-way Clustered DataI would like to run a simple t-test on whether means of two groups are significantly different. The …
How to calculate time varying exponentially weighted moving correlation whose mean is not zero?How can we calculate the time-varying EWMA correlation matrix in Stata when mean is not zero?? …
Creating categorical variables with multiple different conditions from continuous variablesHi, I am trying to create a categorical variable of "activity". I want 0=<150 mins of activity. …
predicted probability issueDear community! I am struggling with a choice of command to calculate predicted probabilities of eac…
Subscribe to:
Post Comments (Atom)
0 Response to Generate a new variables, with the last two numbers of another variable
Post a Comment