[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: combining two variables into one with half-yearly date format
I have two time variables in my dataset - one for year and one for semester.
Both of these variables are numeric with Year containing four-digit year
values ranging from 1990 to 2005 and Semester is a 0 1 variable for fall
and spring. The dataset is structured such that for each id every year has
two semesters. I would like to combine the Year and Semester variables into
one time variable to allow me to work with the dataset as a panel.
Ultimately I hope to to tsset the dataset once I have the new variable.
How do I recode (or replace) the Year and Semester variables to create one
variable that is formated in the half-yearly date format? As an end result
I would like to have one variable that reads 1990h1 for spring term 1990 and
1990h2 for fall term 1990, etc.
What I currently have:
ID Year Semester
1 1990 F
1 1990 S
2 1991 F
2 1991 S
What I would like to have:
Thank you in advance for your help.
PhD candidate in Higher Education
* For searches and help try: