biometrician / abe

An R package for Augmented Backward Elimination
GNU General Public License v3.0
3 stars 0 forks source link

#22: question regarding a warning #22

Closed biometrician closed 1 year ago

biometrician commented 1 year ago

I am experimenting with the R code from the manuscript draft Version 6.

# Load packages ---------------------------------------------------
library(abe)        # variable selection + stability measures (abe, abe.resamling)
library(Hmisc)
library(shrink)
library(survival)

# Load data ------------------------------------------------------
data("GBSG", package = "shrink")

GBSG$enodes <- exp(-0.12 * GBSG$posnodal)
GBSG$prm.log2 <- log(GBSG$prm+1,2)
GBSG$esm.log2 <- log(GBSG$esm+1,2)
GBSG$age.spl <- rcspline.eval(GBSG$age, nk = 5, inclx = T)
GBSG$tumgrad.f <- factor(GBSG$tumgrad, levels = c(2, 1, 3))

fit <- coxph(Surv(rfst, cens) ~ age.spl + factor(menostat) + prm.log2
             + esm.log2 + tumsize +  enodes + tumgrad.f + strata(htreat),
             data = GBSG, x = TRUE, y = TRUE)

abe(fit, GBSG, include = "htreat", active = "menostat", tau = 0.05,
               exp.beta = TRUE, exact = TRUE, criterion = "alpha", alpha = 0.2,
               type.factor = "factor", verbose = FALSE)     

abe.fit1 <- abe(fit, GBSG, include = "htreat", active = "menostat", tau = 0.05,
               exp.beta = TRUE, exact = TRUE, criterion = "alpha", alpha = 0.2,
               type.factor = "factor", verbose = FALSE)            

In the first call to abe, I receive a Warning. However, in the second I do not get an Warning. Why?

abe.fit3 <- abe(fit, GBSG, include = "htreat", active = "menostat", tau = Inf,
               exp.beta = TRUE, exact = TRUE, criterion = "alpha", alpha = 0.2,
               type.factor = "individual", verbose = FALSE) 
summary(abe.fit3)

In the third call, type.factor = "individual" leads to a Warning, which I would expect. Do I understand the package correctly, that in this case type.factor = "factor" is used even if something different was used in the original call?

rokblagus commented 1 year ago

in the first call to abe you get the warning as to alert you to the fact that age.spl will be treated in such a way that all the components are dropped from the model. In the line starting with abe.fit1<- I get the same warning as in the previous call, so I am not sure what you mean? Yes, in the third call the argument type.factor="individual" is discarded and option type.factor="factor" is used; see vignette pages 10-12.

biometrician commented 1 year ago

Thanks. Everything is clear now.