Hi,
I have a column containing different number and weights for grocery products (weights). Some products have the value of round numbers ( 1, 2,13) and I want to maintain these, but I would like the values that are not round numbers to be changed to one.
For instance a weight like .23 should be one and the same for 2.78.
As all the numbers I want to change have a "." in common, I tried the following command;
replace weights =1 if weights ==.
This did not work. Does anyone have a clue what might work?
Thanks
Terje
Related Posts with Replacing values
Dropping variablesHi Guys, Need help with dropping a variable. This is my data: ccode ifscode country group region i…
How to write a more efficient code calculating a weighted index?Hi, I use the following code to calculate a weighted zipf index: gen zipfindlight`var' = zipf13*in…
And how to write the following more efficiently: reg dep zipf6 zipf7 zipf8 zipf9 zip11 ind6 ind7 ind8 ind9 ind11And how to write the following more efficiently? reg dep zipf6 zipf7 zipf8 zipf9 zip11 ind6 ind7 in…
How to properly citing stata's manual and FAQHi, I wonder to know how can I properly cite the below pdf as well as the Stata FAQ. For the FAQ, I …
Anchor the tssmooth command at start pointHi - I have a dataset with daily observations over 240 sequential days. Is there a way to calculate …
Subscribe to:
Post Comments (Atom)
0 Response to Replacing values
Post a Comment