I want to Categorize float variable which has letters as its elements.
Elements:
Horse, Camel, Car, Truck, Walk, Bus, Donkey.
I now want to categorize them into 1 for Animal. 0 for Non-animal.
I've tried to create a new variable
Mode_of_transport = 0
replace Mode_of_transport=1 if old_variable=="Horse"|old_variable=="Donkey"
It's giving me "mismatch"
any suggestions?
Related Posts with How to Categorize float variable
svyset: missing standard error because of stratum with single sampling unitSince the dataset I'm using has a Stratum (v022) with only one PSU (v021), and I have to use the fol…
labels of yDear All, I have this dataset Code: * Example generated by -dataex-. To install: ssc install dataex…
Covariances across groups and quarters Code: * Example generated by -dataex-. To install: ssc install dataex clear input byte qrtr float(…
zoib regressionHi everyone, I have used the zero-one inflated beta regression but I have concerns. My dependent var…
metaprop - show subgroup pooled estimates onlyI using metaprop on 160 studies, subgrouping data by country. I want to suppress the study-level est…
Subscribe to:
Post Comments (Atom)
0 Response to How to Categorize float variable
Post a Comment