Dear Stata Users,
I encounter a data management problem, which is to split a variable into two parts.
I know I can use split command to seperate SexAge and Race. e.g. split SexAge_Race, parse(_)
But I don't know what command to seperate Sex and Age. There is no space or comma between Sex and Age..
My original variables look like this
I want my variables look like as follows:
subject_ID Sex Age Race
1 MALE 41.2 White
2 FEMALE 42.9 White
3 FEMALE 38.5 White
4 FEMALE 35.6 Hispanic
5 FEMALE 48.5 White
********************************************
Please give me some advice ! Thank You!!
I encounter a data management problem, which is to split a variable into two parts.
I know I can use split command to seperate SexAge and Race. e.g. split SexAge_Race, parse(_)
But I don't know what command to seperate Sex and Age. There is no space or comma between Sex and Age..
My original variables look like this
subject_ID | SexAge_Race |
1 | MALE41.2_White |
2 | FEMALE42.9_White |
3 | FEMALE38.5_White |
4 | FEMALE35.6_Hispanic |
5 | FEMALE48.5_White |
subject_ID Sex Age Race
1 MALE 41.2 White
2 FEMALE 42.9 White
3 FEMALE 38.5 White
4 FEMALE 35.6 Hispanic
5 FEMALE 48.5 White
********************************************
Please give me some advice ! Thank You!!
Comment