I have a variable 'implementscheme' which contains the names of various agriculture implements and the subsidy schemes associated. I have to separate the variable into 'implement' and 'scheme'. There are 150 different implements and 5 different schemes. Hence, I am not able to split the variable using space.
The command I am using is split implementscheme, p("State Plan" "BGREI" "NMOOP" "NFSM" "SMAM" "RKVY" "NFSM-oilseeds") .
The resulting variable I get only has the separated implement names. I also need a separate variable containing scheme names for those implements. Please help on that. Data eg. below: (In the data, scheme name is at last, say State Plan or NFSM. Implement name comes in the front.)
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str86 implementscheme "PumpSet State Plan" "PumpSet State Plan" "PumpSet NFSM" "PumpSet State Plan" "Folding LDPE Irrigation Pipe State Plan" "IrrigationPipe NFSM" "PumpSet State Plan" "Folding LDPE Irrigation Pipe State Plan" "Zerotillage/SeedCumFertilizerDrill State Plan" "Tractor State Plan" "SprayersDusterPower NFSM" "Zerotillage/SeedCumFertilizerDrill State Plan" "SprayersDusterManual State Plan" "Weeder State Plan" "PumpSet NFSM" "Zerotillage/SeedCumFertilizerDrill NFSM" "PumpSet State Plan" "PumpSet NFSM" "Folding LDPE Irrigation Pipe State Plan" "PumpSet NFSM" end
0 Response to Splitting one variable containing two variable data
Post a Comment