Login or Register
Log in with
Forums
FAQ
Search in titles only
Search in General only
Advanced Search
Search
Home
Forums
Forums for Discussing Stata
General
You are not logged in. You can browse but not post. Login or
Register
by clicking 'Login or Register' at the top-right of this page. For more information on Statalist, see the
FAQ
.
Announcement
Collapse
No announcement yet.
X
Collapse
Posts
Latest Activity
Search
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Filtered by:
Clear All
new posts
Tess Gecha
Join Date:
Aug 2021
Posts:
22
#1
Adding Value to Variable
29 Apr 2022, 12:46
Good afternoon,
What is the code for adding 0.01 to only the zero values of a variable?
Best,
Tess
Tess Gecha
Join Date:
Aug 2021
Posts:
22
#2
29 Apr 2022, 12:48
Sort of like "add 0.01 if variableX equals 0." So none of the non-zero values would change.
Comment
Post
Cancel
Nick Cox
Join Date:
Mar 2014
Posts:
35239
#3
29 Apr 2022, 13:00
Code:
replace x = 0.01 if x == 0
but this sounds like a fudge of some kind!
Comment
Post
Cancel
Previous
Next
Working...
Yes
No
OK
OK
Cancel
X
Comment