Comments (2)
On 12/15/2015 03:03 PM, Max Gordon wrote:
It seems that |model.matrix()| returns TRUE together with the variable
name. Not sure when this happend, can't find any note of it
https://cran.r-project.org/src/base/NEWS but the following code used
to run fine:set.seed(10)
n <- 500
ds <- data.frame(
ftime = rexp(n),
fstatus = sample(0:1,size = n,replace = TRUE),
x = factor(sample(LETTERS[1:4],size = n,replace = TRUE)),
boolean = sample(c(TRUE,FALSE),size = n,replace = TRUE),
subsetting = factor(sample(c(TRUE,FALSE),size = n,replace = TRUE)))library(rms)
dd <<- datadist(ds)
options(datadist="dd")fit <- cph(Surv(ftime,fstatus == 1)~ x + boolean,data=ds)
Now it throws an |Error in X[, mmcolnames, drop = FALSE] : subscript
out of bounds| as the mmcolnames has the name for the boolean variable
while the |X <- model.matrix(sformula, X)| returns the boolean column
with the name |booleanTRUE|.Btw - congratulations on the second edition. Great to see that it has
finally arrived.
Thanks Max.
I hadn't tested recent changes with a logical variable. Will fix this
and will make a new release of rms soon as I've made other changes too.
Frank
—
Reply to this email directly or view it on GitHub
#15.
Frank E Harrell Jr Professor and Chairman School of Medicine
Department of *Biostatistics* *Vanderbilt University*
from rms.
This has now been fixed and I just submitted a new version (with the fix) to CRAN.
from rms.
Related Issues (20)
- "Error in solve.default system is computationally singular" after restricted cubic splines with df > 3 (Cox Regression)
- the abscissa of the intersection
- datadist cannot find in function environment but can fine in global environment.
- latex works for cph, generates .tex but does not work for anova tinytex or anova problem
- .Rbuildignore contains broken symlink
- riskdist of val.prob couldn't be set to FALSE and remove risk distribution in plot
- dead link at http://hbiostat.org/R/rms/
- program logic error: variables vary in length but subset= was not given when event is not a logical HOT 1
- Issue installing on R version 4.0.0 HOT 2
- Fatal error in Gls(B > 0)
- allow to pass argument to solver (SparseM)
- Anova command does not run with lapply
- How to include time-vary covariates using tt=function from coxph in rcs code?
- print.Gls() using corSymm() returns error message.
- lrm and Rcmdr conflict HOT 2
- rexVar in survival model (cph) HOT 1
- How to estimate OR and 95%CI using Predict funtion for svyglm model?
- RCS curve in competing risk model
- Estimating contrasts and marginal effects from aregImpute multiply imputed data
- Accidentally turning on backward step-down procedure in `validate` and `calibrate`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rms.