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

Problem Rounding Up #24

Open
EvmARodCur opened this issue Sep 16, 2024 · 0 comments
Open

Problem Rounding Up #24

EvmARodCur opened this issue Sep 16, 2024 · 0 comments

Comments

@EvmARodCur
Copy link

When trying to use the round suppress, it sometimes rounds with a very big negative objective value. To show this, using the r code "test_code"

`
###fill
test<-read.table(file="CSV_CODIF.csv" , sep="\t", header=TRUE)
###fill

names <-colnames(test)

tot_code<-c("C1_1","C2_1","C3_1","C4_1")
dirname <-"tauargus_files"
filename <-"ex1"
dir_temp<-paste("/",dirname,"/",filename,".csv",sep="")

###fill
file_hrc=c("U:/anonimizacion/r tau argus/comprobacion/tabla_a_codificar/hrc_C1.hrc")
###fill

list_hrc<-setNames(file_hrc,"C1")

library(rtauargus)

###fill
loc_tauargus<-"C:/Users/ext-arodcur/Desktop/TauArgus4.2.4b2/TauArgus4.2.4b2/TauArgus.exe"
###fill

options(rtauargus.tauargus_exe = loc_tauargus)

ex1<- tab_rtauargus(
test,
dir_name = dirname,
files_name = filename,
explanatory_vars = names[-length(names)],
safety_rules = "FREQ(5,20)",
value= "OBS_VALUE",
freq = "OBS_VALUE",
totcode = tot_code,
suppress= "RND(1,5,0,1000,0)",
hrc=list_hrc,
verbose = TRUE,
)

###fill
test<-read.table(file="CSV_CODIF_2.csv" , sep="\t", header=TRUE)
###fill

names <-colnames(test)

tot_code<-c("C1_1","C2_1","C3_1","C4_1")
dirname <-"tauargus_files"
filename <-"ex1"
dir_temp<-paste("/",dirname,"/",filename,".csv",sep="")

file_hrc=c("hrc_C1.hrc")
list_hrc<-setNames(file_hrc,"C1")

ex1<- tab_rtauargus(
test,
dir_name = dirname,
files_name = filename,
explanatory_vars = names[-length(names)],
safety_rules = "FREQ(5,20)",
value= "OBS_VALUE",
freq = "OBS_VALUE",
totcode = tot_code,
suppress= "RND(1,5,0,1000,0)",
hrc=list_hrc,
verbose = TRUE,
)`

if we run the data from the csv CSV_CODIF
CSV_CODIF.csv

that has a hierarchy in the first column in the file hrc_C1 (must be changed to hrc format):
hrc_C1.csv

we get that negative objective value:
image
with rounded values far from the original values:
image
Meanwhile if we do the same with CSV_CODIF_2 that has the same columns and hierarchy but different values:

CSV_CODIF_2.csv

it doesnt happend:
image
Also, if we use Tau-Argus with the first file it turns out correct:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant