Hello,
I want to ask something easy. If I have a variable (var1) and I computed two more variables like: var2=var1 - 5, var3=var1 + 5. How can I create an interval of these two vars, where var2 is the lower limit and var3 is the upper limit?
An easy example:
var1 var2 var3
10 5 15
20 15 25
30 25 35
40 35 45
50 45 55
60 55 65
70 65 75
80 75 85
90 85 95
100 95 105
So I want to create a new var which will be the interval of var2, var3. That is:
var4
5-15
15-25
25-35
35-45
45-55
55-65
65-75
75-85
85-95
95-105
I tried concat but it did not work the way I wanted. I need var4 so later I can count the number of observations which are observed in every interval.
I want to ask something easy. If I have a variable (var1) and I computed two more variables like: var2=var1 - 5, var3=var1 + 5. How can I create an interval of these two vars, where var2 is the lower limit and var3 is the upper limit?
An easy example:
var1 var2 var3
10 5 15
20 15 25
30 25 35
40 35 45
50 45 55
60 55 65
70 65 75
80 75 85
90 85 95
100 95 105
So I want to create a new var which will be the interval of var2, var3. That is:
var4
5-15
15-25
25-35
35-45
45-55
55-65
65-75
75-85
85-95
95-105
I tried concat but it did not work the way I wanted. I need var4 so later I can count the number of observations which are observed in every interval.
Comment