search for: lrm

Displaying 20 results from an estimated 340 matches for "lrm".

Did you mean: drm
2010 Dec 25
2
predict.lrm vs. predict.glm (with newdata)
Hi all I have run into a case where I don't understand why predict.lrm and predict.glm don't yield the same results. My data look like this: set.seed(1) library(Design); ilogit <- function(x) { 1/(1+exp(-x)) } ORDER <- factor(sample(c("mc-sc", "sc-mc"), 403, TRUE)) CONJ <- factor(sample(c("als", "bevor", "nac...
2005 Jul 12
1
Design: predict.lrm does not recognise lrm.fit object
Hello I'm using logistic regression from the Design library (lrm), then fastbw to undertake a backward selection and create a reduced model, before trying to make predictions against an independent set of data using predict.lrm with the reduced model. I wouldn't normally use this method, but I'm contrasting the results with an AIC/MMI approach. The scr...
2017 Sep 14
3
Help understanding why glm and lrm.fit runs with my data, but lrm does not
...uot;glm" function as shown below. library(rms) gusto <- spss.get("GustoW.sav") fit <- glm(DAY30~AGE+HYP+factor(KILLIP)+HRT+ANT,family=binomial(link="logit"),data=gusto,x=TRUE,y=TRUE) However, my review of the literature and other websites suggest I need to use "lrm" for the purposes of producing a nomogram. When I run the command using "lrm" (see below) I get an error message saying: Error in lrm(DAY30 ~ AGE + HYP + KILLIP + HRT + ANT, gusto2) : Unable to fit model using "lrm.fit" My code is as follows: gusto2 <- gusto[,c(1,3,5...
2012 May 27
2
Unable to fit model using “lrm.fit”
Hi, I am running a logistic regression model using lrm library and I get the following error when I run the command: mod1 <- lrm(death ~ factor(score), x=T, y=T, data = env1) Unable to fit model using ?lrm.fit? where score is a numeric variable from 0 to 6. LRM executes fine for the following commands: mod1 <- lrm(death ~ score, x=T, y=T, data...
2004 Mar 22
2
Handling of NAs in functions lrm and robcov
Hi R-helpers I have a dataframe DF (lets say with the variables, y, x1, x2, x3, ..., clust) containing relatively many NAs. When I fit an ordinal regression model with the function lrm from the Design library: model.lrm <- lrm(y ~ x1 + x2, data=DF, x=TRUE, y=TRUE) it will by default delete missing values in the variables y, x1, x2. Based on model.lrm, I want to apply the robust covariance estimator using a cluster variable: model.robcov.lrm <- robcov(model.lrm, cluster=cl...
2017 Sep 14
0
Help understanding why glm and lrm.fit runs with my data, but lrm does not
...n below. > > library(rms) > gusto <- spss.get("GustoW.sav") > fit <- glm(DAY30~AGE+HYP+factor(KILLIP)+HRT+ANT,family=binomial(link="logit"),data=gusto,x=TRUE,y=TRUE) > > However, my review of the literature and other websites suggest I need to use "lrm" for the purposes of producing a nomogram. When I run the command using "lrm" (see below) I get an error message saying: > Error in lrm(DAY30 ~ AGE + HYP + KILLIP + HRT + ANT, gusto2) : > Unable to fit model using "lrm.fit" > > My code is as follows: > gus...
2017 Sep 14
1
Help understanding why glm and lrm.fit runs with my data, but lrm does not
...ks. Please give the original source of that dataset. That dataset is a tiny sample of GUSTO-I and not large enough to fit this model very reliably. A nomogram using the full dataset (not publicly available to my knowledge) is already available in http://biostat.mc.vanderbilt.edu/tmp/bbr.pdf Use lrm, not lrm.fit for this. Adding maxit=20 will probably make it work on the small dataset but still not clear on why you are using this dataset. Frank ------------------------------ Frank E Harrell Jr Professor School of Medicine Department of *Biostatistics* *Vanderbilt University...
2012 Jul 31
2
phantom NA/NaN/Inf in foreign function call (or something altogether different?)
...experts, Please forgive the puzzled title and the length of this message - I thought it would be best to be as complete as possible and to show the avenues I have explored. I'm trying to fit a linear model to data with a binary dependent variable (i.e. Target.ACC: accuracy of response) using lrm, and thought I would start from the most complex model (of which "sample1.lrm1" is a trimmed version). I got the error shown below. (sample1 is available at http://tinyurl.com/bwqq7ya) For info: > str(sample1) 'data.frame': 14022 obs. of 5 variables: $ Target.ACC : Fact...
2005 Aug 12
0
HowTo derive a correct likelihood-ratio chi-squared statistic from lrm() with a rsc() ?
Dear R helpers, >From the lrm( ) model used for binary logistic regression, we used the L.R. model value (or the G2 value, likelihood-ratio chi-squared statistic) to evaluate the goodness-of-fit of the models. The model with the lowest G2 value consequently, has the best performance and the highest accuracy. However our mo...
2009 Oct 25
1
Getting AIC from lrm in Design package
I am trying to obtain the AICc after performing logistic regression using the Design package. For simplicity, I'll talk about the AIC. I tried building a model with lrm, and then calculating the AIC as follows: likelihood.ratio <- unname(lrm(succeeded~var1+var2,data=scenario,x=T,y=T)$stats["Model L.R."]) #Model likelihood ratio??? model.params <- 2 #Num params in my model AIC = -2*log(likelihood.ratio) + 2 * model.params However, this is almost c...
2009 Aug 21
1
Possible bug with lrm.fit in Design Library
Hi, I've come across a strange error when using the lrm.fit function and the subsequent predict function. The model is created very quickly and can be verified by printing it on the console. Everything looks good. (In fact, the performance measures are rather nice.) Then, I want to use the model to predict some values. I get the following error:...
2009 Aug 29
3
lrm in Design
Hello everybody, I am trying to do a logistic regression model with lrm() from the design package. I am comparing to groups with different medical outcome which can either be "good" or "bad". In the help file it says that lrm codes al responses to 0,1,2,3, etc. internally and does so in alphabetical order. I would guess this means bad=0 and good=1....
2009 Sep 04
2
lrm in Design package--missing value where TRUE/FALSE needed
Hi, A error message arose while I was trying to fit a ordinal model with lrm() I am using R 2.8 with Design package. Here is a small set of mydata: RC RS Sex CovA CovB CovC CovD CovE 2 1 0 1 1 0 -0.005575280 2 2 1 0 1 0 1 -0.001959580 2 3 0 0 0 1 0 -0.004725880 2 0 0 0 1 0 0 -0.005504850 2 2 1 1 0 0 0 -0.003880170 1 2 1 0 0 1 0 -0.006074230 2 2 1 0 0 1 1 -0.003963920...
2009 Jul 17
2
Getting the C-index for a dataset that was not used to generate the logistic model
...and "owns own home" (dichotomous) The training data is *trainingData[1,] = c(0,12,0)* *...* etc and the validation data is *validationData[1,] = c(1,35,1)* *...* etc I use Prof. Harrell's excellent Design modules to perform a logistic regression on the training data like so: *logit.lrm <- lrm(gotALoan ~ hourlyIncome+ownsHome, data=trainingData)* *lrm(formula = logit.lrm)$stats[6]* (output is C 0.8739827 - i.e., just the C-index) ** I really like the ability to extract the C-index (or ROC AUC), because this is a factor that I find very helpful in comparing various models. Howev...
2006 Nov 14
1
Using lrm
Hi, I have to build a logistic regression model on a data set that I have. I have three input variables (x1, x2, x3) and one output variable (y). The syntax of lrm function looks like this lrm(formula, data, subset, na.action=na.delete, method="lrm.fit", model=FALSE, x=FALSE, y=FALSE, linear.predictors=TRUE, se.fit=FALSE, penalty=0, penalty.matrix, tol=1e-7, strata.penalty=0, var.penalty=c('simple','sand...
2008 Mar 03
1
using 'lrm' for logistic regression
Hi R, I am getting this error while trying to use 'lrm' function with nine independent variables: > res = lrm(y1994~WC08301+WC08376+WC08316+WC08311+WC01001+WC08221+WC08106+WC0810 1+WC08231,data=y) singular information matrix in lrm.fit (rank= 8 ). Offending variable(s): WC08101 WC08221 Error in j:(j + params[i] - 1) : NA/NaN argument...
2011 Jun 23
2
Rms package - problems with fit.mult.impute
Hi! Does anyone know how to do the test for goodness of fit of a logistic model (in rms package) after running fit.mult.impute? I am using the rms and Hmisc packages to do a multiple imputation followed by a logistic regression model using lrm. Everything works fine until I try to run the test for goodness of fit: residuals(type=c("gof")) One needs to specify y=T and x=T in the fit. But I get a warning message when I do that with fit.multiple.impute. a<-aregImpute(~med.hist.err+ med.discr+newLiving+No.drugs+Days.categ+Los+A...
2008 Oct 09
2
Singular information matrix in lrm.fit
Hi R helpers, I'm fitting large number of single factor logistic regression models as a way to immediatly discard factor which are insignificant. Everything works fine expect that for some factors I get error message "Singular information matrix in lrm.fit" which breaks whole execution loop... how to make LRM not to throw this error and simply skip factors with singularity problem... alternative solution also appreciated. Thanks
2006 Oct 02
1
a question regarding 'lrm'
Hi List, I don't understand why 'lrm' doesn't recognize the '~.' formula. I'm pretty sure it was working before. Please see below: I'm using R2.3.0, WinXP, Design 2.0-12 thanks, ...Tao > dat <- data.frame(y=factor(rep(1:2,each=50)), x1=rnorm(100), x2=rnorm(100), x3=rnorm(100)) > lrm(y~., data=dat,...
2009 Aug 21
1
Repost - Possible bug with lrm.fit in Design Library
Hi, I've come across a strange error when using the lrm.fit function and the subsequent predict function. The model is created very quickly and can be verified by printing it on the console. Everything looks good. (In fact, the performance measures are rather nice.) Then, I want to use the model to predict some values. I get the following error:...