I want to add another variable "group" which is based on size(values), I want to include only those observations for which dev is 1.
size is distributed into three groups (low, medium,high) on the basis of size values.
Hence in the given data. first three values of size are (3,5,7) as said to be small. then medium(60,65,85) and at the end high (96,97 and 99)
New data would be like this.
size is distributed into three groups (low, medium,high) on the basis of size values.
Hence in the given data. first three values of size are (3,5,7) as said to be small. then medium(60,65,85) and at the end high (96,97 and 99)
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str4 size float(equiv dev) "3" 50 1 "5" 55 1 "7" 55 1 "10" 60 0 "12" 5 0 "25" 62 0 "35" 62 0 "45" 56 0 "50" 0 0 "60" 25 1 "65" 20 1 "70" 0 0 "75" 0 0 "76" 0 0 "80" 25 0 "85" 26 1 "90" 24 0 "95" 12 0 "96" 13 1 "97" 21 1 "99" 65 0 "99" 32 1 end
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str4 size float(dev equiv) str6 group "3" 1 50 "low" "5" 1 55 "low" "7" 1 55 "low" "10" 0 60 "." "12" 0 5 "." "25" 0 62 "." "35" 0 62 "." "45" 0 56 "." "50" 0 0 "." "60" 1 25 "medium" "65" 1 20 "medium" "70" 0 0 "" "75" 0 0 "" "76" 0 0 "" "80" 0 25 "" "85" 1 26 "medium" "90" 0 24 "" "95" 0 12 "" "96" 1 13 "high" "97" 1 21 "high" "99" 0 65 "" "99" 1 32 "high" end
Comment