Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange behaviour with ds.Boole when V2 is a negative value #434

Open
davraam opened this issue Dec 5, 2021 · 0 comments
Open

Strange behaviour with ds.Boole when V2 is a negative value #434

davraam opened this issue Dec 5, 2021 · 0 comments
Labels

Comments

@davraam
Copy link
Member

davraam commented Dec 5, 2021

When we set the argument V2 to a single negative value, the dsBoole doesn't creates the binary variable correctly, even if V2 is within the range of the variable V1. But in addition has a strange behaviour as it overwrites the input variable V1 (this can be a column in the original dataset).

Here is an example using the SURVIVAL.EXPAND_WITH_MISSING data. Example 1 works as expected but example 2 has this strange bahaviour.

ds.summary("D$age.60")

# Example 1: V2 is a positive integer value, within the range of V1
ds.Boole(V1='D$age.60', V2='1', Boolean.operator = "<", 
         numeric.output = TRUE, newobj = "boole_1")
ds.table("boole_1")
ds.summary("D$age.60")

# Example 2: V2 is a negative integer value, within the range of V1
ds.Boole(V1='D$age.60', V2='-5', Boolean.operator = "<", 
         numeric.output = TRUE, newobj = "boole_2")
ds.table("boole_2")
ds.summary("D$age.60")  

All the examples below work fine

# Example 3: V2 is zero, within the range of V1
ds.Boole(V1='D$age.60', V2='0', Boolean.operator = "<", 
numeric.output = TRUE, newobj = "boole_3")
ds.table("boole_3")
ds.summary("D$age.60")

# Example 4: V2 is a positive numeric value, within the range of V1
ds.Boole(V1='D$age.60', V2='7.6', Boolean.operator = "<", 
         numeric.output = TRUE, newobj = "boole_4")
ds.table("boole_4")
ds.summary("D$age.60")

# Example 5: V2 is a positive value, outside the range of V1
ds.Boole(V1='D$age.60', V2='70', Boolean.operator = "<", 
         numeric.output = TRUE, newobj = "boole_5")
ds.table("boole_5")
ds.summary("D$age.60")
@davraam davraam added the bug label Dec 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant