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
traj command with hierarchical data structureI'm interested in using the user-written traj command (link below) to identify latent trajectories o…
Dipendent Double-Sorting 25 PortfoliosDear all, I am struggling to replicate the FF-25 portfolios with a variant, I should employ a depend…
Cluster Randomized Controlled TrialI have a question about the Cluster Randomized Controlled Trial. Is it recommended to perform the sv…
Interaction between variables changes the results fundamentally!Dear All, I would appreciate your help on the following please: The correlation between y and x1 x2 …
Generate variables with forvalsHello Statalist, I have a dataset which contains the following variables: firm (every firm has an as…
Subscribe to:
Post Comments (Atom)
0 Response to Replacing values
Post a Comment