Coder Social home page Coder Social logo

Comments (4)

bozenne avatar bozenne commented on August 24, 2024

Hello Samuel,

Humm, I tried to replicate the issue without success:

 set.seed(1)
    dt <- simBuyseTest(n.T = 50, n.C = 50,
                       names.strata = "strat_column", n.strata = 3,
                       argsTTE = list(name = c("tte1","tte2","tte3"), name.censoring = c("cnsr1","cnsr2","cnsr3"),
                                      scale.T = c(200,100,250), scale.censoring.T = c(10^5,10^5,10^5),
                                      scale.C = c(200,100,250), scale.censoring.C = c(10^5,10^5,10^5)),
                       argsBin = list(name = "bin_var"))

    formula1 <- treatment ~ strat_column + tte(tte1, status = cnsr1, threshold = 10, restriction = 365) + tte(tte2, status = cnsr2, threshold = 10, restriction = 365) + bin(bin_var, operator = "<0") + tte(tte3, status = cnsr3, threshold = 10, restriction = 365)

    GPC.v1 <- BuyseTest(formula1,
                        data = dt,
                        trace = FALSE)

    GPC.v2 <- BuyseTest(treatment = "treatment",
                        strata = "strat_column",
                        endpoint = c("tte1","tte2","bin_var","tte3"),
                        status = c("cnsr1","cnsr2","cnsr3"),
                        type = c("tte","tte","bin","tte"),
                        operator = c(">0",">0","<0",">0"),
                        threshold = c(10,10,NA,10),
                        restriction = c(365,365,NA,365),
                        data = dt,
                        trace = FALSE)

Could you provide a reproducible example so I can debug it?
Thanks!
Brice

from buysetest.

SamSalvaggio avatar SamSalvaggio commented on August 24, 2024

Thanks for your response.

Here is the code, it seems it works when specifying the formula similarly to "GPC.v2", however it returns the same error message when using the formula1 variable in GPC.v1

Code :

set.seed(1)
dt <- simBuyseTest(n.T = 50, n.C = 50,
                   names.strata = "strat_column", n.strata = 6,
                   argsTTE = list(name = c("tte1","tte2","tte3", "tte4", "tte5", "tte6", "tte7", "tte8", "tte9"), 
                                  name.censoring = c("cnsr1","cnsr2","cnsr3", "cnsr4", "cnsr5", "cnsr6", "cnsr7", "cnsr8", "cnsr9"),
                                  scale.T = c(200,100,250,300,150,200,350,400,450), scale.censoring.T = c(10^5,10^5,10^5,10^5,10^5,10^5,10^5,10^5,10^5),
                                  scale.C = c(200,100,250,300,150,200,350,400,450), scale.censoring.C = c(10^5,10^5,10^5,10^5,10^5,10^5,10^5,10^5,10^5)),
                   argsBin = list(name = "bin_var"))

formula1 <- treatment ~ strat_column + 
  tte(tte1, status = cnsr1, threshold = 10, restriction = 365) + 
  tte(tte2, status = cnsr2, threshold = 10, restriction = 365) + 
  tte(tte3, status = cnsr3, threshold = 10, restriction = 365) +
  tte(tte4, status = cnsr4, threshold = 10, restriction = 365) +
  bin(bin_var, operator = "<0") + 
  tte(tte5, status = cnsr5, threshold = 10, restriction = 365) + 
  tte(tte6, status = cnsr6, threshold = 10, restriction = 365) + 
  tte(tte7, status = cnsr7, threshold = 10, restriction = 365) +
  tte(tte8, status = cnsr8, threshold = 10, restriction = 365) +
  tte(tte9, status = cnsr9, threshold = 10, restriction = 365)

GPC.v1 <- BuyseTest(formula1,
                    data = dt,
                    trace = FALSE)

GPC.v2 <- BuyseTest(treatment = "treatment",
                    strata = "strat_column",
                    endpoint = c("tte1","tte2","tte3","tte4","bin_var","tte5","tte6","tte7","tte8","tte9"),
                    status = c("cnsr1","cnsr2","cnsr3","cnsr4","cnsr5","cnsr6","cnsr7","cnsr8","cnsr9"),
                    type = c("tte","tte","tte","tte","bin","tte","tte","tte","tte","tte"),
                    operator = c(">0",">0",">0",">0","<0",">0",">0",">0",">0",">0"),
                    threshold = c(10,10,10,10,NA,10,10,10,10,10),
                    restriction = c(365,365,365,365,NA,365,365,365,365,365),
                    data = dt,
                    trace = FALSE)


from buysetest.

bozenne avatar bozenne commented on August 24, 2024

Thanks! I can reproduce the error now. I'll have a look and will fix it - probably only next week though

from buysetest.

bozenne avatar bozenne commented on August 24, 2024

Fixed in the new version 2.4.3

from buysetest.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.