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
xtabond2 and xtdpdsysI am trying to replicate the xtdpdsys command using the xtabond2 command, but I keep getting differe…
xtdpdsys & Hansen TestHello everyone, I am using the xtdpdsys with the option vce(robust) and I am trying to get the Hanse…
understand the stata codeI find a code for generating 97th percentile for each year. However, I am not sure why the percentil…
-marginsplot- after -logit-Hello, After running a logit model, -logit- command with -vce(cluster)-, with continuous-by-continu…
create new variableHi all, I have an unbalanced data HTML Code: tsset code date panel variable: code (unba…
Subscribe to:
Post Comments (Atom)
0 Response to Replacing values
Post a Comment