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
Stata omitting two levels of a variable instead of oneI'm presently working on analyzing a survey with multiple waves. I've used append to attach the diff…
Not duplicating Mata code / Using STATA in MataI have a function which is straightforward to implement in both the ado scripting language and mata.…
loop over files in a folder to do an operation and save the combined result as datasetHello everyone!! I should specify, I am new to stata, so if i misuse terminology, please forgive me…
heatplot assistanceHello dear statalist members, I'm working with the heatplot command and I have an issue with the lo…
Is there any way to create age and education variables of a father?Hi all, I am working with the Multiple Indicator Cluster Survey (MICS) whose research design is sim…
Subscribe to:
Post Comments (Atom)
0 Response to Replacing values
Post a Comment