Comments (4)
Run y ~ Year then y ~ scored(Year) which will give you a test of association that is the same as using factor() as well as something you don't get - a test of linearity against all alternatives to linearity (factor). Hear Year is numeric interval-scaled when stored in the data frame/data table.
from rms.
To open an issue without providing the code you wrote that caused the error is not a good way to report problems.
I am fairly certain that you used factor( ) or as.factor( ) inside the model formula. It was the design of rms that this never worked. It only worked by accident before. Now it is explicitly disallowed. You need to define the type of variable it is in the data frame or data table.
To go to the trouble of downgrading to older versions is quite a waste of time when the solution is extremely easy.
from rms.
My apologies, I assumed it should be clear that the complete code would look like that:
lrm(y~x1+factor(x2), data=mydata)
where x2 could be any type of variable. Yes, it took me quite some time to downgrade but I really assumed that this must be a bug in the latest version of either Hmisc or rms. Iβve been using this notation extensively in many of my R scripts for years without any issues and it still seems to work in other functions like lm(). If itβs not a bug then I can close this issue.
I always found it extremely handy to use this notation as it allows to quickly adapt a regression from something like
lrm(y~x1+Year, data=mydata)
to
lrm(y~x1+factor(Year), data=mydata)
where Year enters as numeric variable in the first case while the second version estimates the model with year fixed effects. May I kindly ask how I can achieve the same without using factor() in the formula and without defining the variable as a factor in the data frame?
from rms.
Thank you very much for answer. With scored I get even more information and I can adapt my scripts with search+replace.
from rms.
Related Issues (20)
- After plot with nomogram(), the outputs are crowded together and the lines don't strehch HOT 1
- `poma` fails for response variables with >= 10 levels coded as a factor
- "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
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.