search for: datadist

Displaying 20 results from an estimated 108 matches for "datadist".

2011 Apr 12
1
Datadist error
Dear all, I have performed a simple logistic regression using the lrm function from the Design library. Now I want to plot the summary, or make a nomogram. I keep getting a datadist error: options(datadist= m.full ) not created with datadist. I have tried to specify datadist beforhand (although I don't know why it should be done): ddist<-datadist(d) ##where d is my dataset options(datadist="ddist") This doesn't work. It only works when I c...
2009 Jul 09
2
datadist() in Design library
Hi I got an error message using datadist() from Design package: > library(Design,T) > dd <- datadist(beta.final) > options(datadist="dd") > lrm(Disease ~ gsct+apcct+rarct, x=TRUE, y=TRUE) Error in eval(expr, envir, enclos) : object "Disease" not found All variables inclduing response variabl...
2007 Jul 25
2
Subscript out of bounds when using datadist() from Design library
I am running R version 2.4.1 on Windows XP. I have a question regarding the datadist() function from the Design library. I have a data.frame (call it my.data) with 4 columns. When I submit the code datadist(data=my.data) I get the following error message: Error in X[[1]] : subscript out of bounds I suspect there may be something wrong with my data.frame (I'm certain there...
2008 Apr 17
1
Error in Design package: dataset not found for options(datadist)
...alled within a function, it can't find the dataset dd: > library(Design) > age <- rnorm(30, 50, 10) > cholesterol <- rnorm(30, 200, 25) > ch <- cut2(cholesterol, g=5, levels.mean=TRUE) > fit <- function(ch, age) + { + d <- data.frame(ch, age) + dd <- datadist(d) + options(datadist="dd") + lrm(ch ~ age, data=d, x=TRUE, y=TRUE) + } > fit(ch, age) Error in Design(eval(m, sys.parent())) : dataset dd not found for options(datadist=) It works outside a function: > d <- data.frame(ch, age) > dd <- datadist(d) > options...
2008 Mar 18
0
Trouble fitting models with nonNULL datadist in Design Library
Having trouble with datadist in the Design library. When I set the datadist option, all of the fitting functions give error messages similar to "Error in exists(x, envir, mode, inherits) : invalid first argument". Code below was run in R version 2.5.0 under windows, but get similar results with R version 6.2, except...
2007 Oct 31
1
datadist options error, DESIGN library
Hello, using the Design library, and the following command (from the Harrell's book, example at Ch.20): dd <- datadist(rx, age, wt, pf, pf.coded, heart, map, hg, sz, sg, ap, bm) options(datadist=='dd') I get the following error: Error in datadist == "dd" : comparison (1) possible only for atomic data or list What does it means? thank you, giulia ____________________________________________...
2003 Nov 04
2
help with nomogram function
I have fitted a logistic regression model > failed.lr2$call lrm(formula = failed ~ Age + task2 + Age:task2, data = time.long, na.action = na.omit) using the Design package functions and would like to generate a nomogram from this model. the datadist information is generated and stored in > ddist time.long$Age time.long$task2 Low:effect 45 <NA> Adjust to 56 both.foam High:effect 68 <NA> Low:prediction 21 both.foam High:p...
2009 Apr 29
1
Error with Design.Function(fit)
...to define limits as the error message seems to suggest? If so, how? The error message, my code, the output and the first few lines of my data are all below. Thank you! "Error in Getlim(at, allow.null = TRUE, need.all = TRUE) : variable dmodel.df does not have limits defined in fit or with datadist" My code: ================== library(Hmisc); library(Design); library(lattice); dmodel.df = read.table("./data_cub3.txt", header=TRUE, nrows=100) f <- ols(dmodel.df$y1 ~ rcs(dmodel.df$x1,3) ) print(f) dd <- datadist(dmodel.df$x1) options(datadist="dd") describe(dm...
2008 May 29
2
Troubles plotting lrm output in Design Library
...el for log odds that Y=1 > L <- .4*(sex=='male') + .045*(age-50) + + (log(cholesterol - 10)-5.2)*(-2*(sex=='female') + 2*(sex=='male')) > # Simulate binary y to have Prob(y=1) = 1/[1+exp(-L)] > y <- ifelse(runif(n) < plogis(L), 1, 0) > > ddist <- datadist(age, blood.pressure, cholesterol, sex) > options(datadist='ddist') > > fit <- lrm(y ~ blood.pressure + sex * (age + rcs(cholesterol,4)), + x=TRUE, y=TRUE) > > par(mfrow=c(2,2)) > plot(fit) # Plot effects of all 4 predictors Error in value.c...
2009 Aug 21
1
applying summary() to an object created with ols()
...t to write the obtained coefficients (incl. Std. Errors, t-, and p-values) into a matrix. Via the *f$coef* command I can only access the betas (1st column) and using the *summary(f)* function I get > summary(f) >Fehler in summary.Design(f) : >adjustment values not defined here or with datadist for lntex lnbeerp lnwinep lntemp pop Does anyone know how I can set the *datadist()* and the *options()* such that I will get access to all coefficients? I tried: > options(datadist=NULL) > f <- ols(lnbcpc ~ lntex + lnbeerp + lnwinep + lntemp + pop, subset(aa, Jahr>=1957 & Ja...
2004 Dec 15
2
using Hmisc and Design library
...0 97.18 data frame "b": time status scores 1 27 0 -126.7 2 24 0 -135.6 3 30 0 -139.5 4 49 0 -137.6 5 27 0 -136.9 when I ran the following using data frame "a", everything is ok. > library(Hmisc,T);library(Design,T) > dd <- datadist(a) > options(datadist='dd') > fit <- cph(Surv(time,status) ~ scores, data=a,surv=T, x=T, y=T) > fit Cox Proportional Hazards Model cph(formula = Surv(time, status) ~ scores, data = data.combined.testing.set.scores, x = T, y = T, surv = T) Obs Events Model L.R. d.f. P Sc...
2009 Jun 17
2
djustment values not defined
Hello,   I am using mod1 <- lrm(y~x1+x2,na.action=na.pass,method="lrm.fit") summary(mod1) and I've got the following error: Error in summary.Design(mod1) : adjustment values not defined here or with datadist for x1 x2   Many thank, Amor [[alternative HTML version deleted]]
2011 May 05
7
Draw a nomogram after glm
..., cex.axis=.6) fun.at=c(.01,.05,seq(.1,.9,by=.1),.95,.99), lmgp=.2, cex.axis=.6) options(Fire=NULL) Result is bad and I have this following error message: Erreur dans value.chk(at, i, NA, -nint, Limval, type.range = "full") : variable L does not have limits defined by datadist Could you help me on the code to draw nomogram. Nb: my English is low, I apologize. Thank for your help Komine -- View this message in context: http://r.789695.n4.nabble.com/Draw-a-nomogram-after-glm-tp3498144p3498144.html Sent from the R help mailing list archive at Nabble.com.
2010 Oct 04
2
i have aproblem --thank you
....cases(x, y, wt) : ²»ÊÇËùÓеIJÎÊý¶¼Ò»Ñù³¤(the length of the augment was different)) i hope you tell me where is the mistake,and maybe i have chosen the wrong function. thank you turly yours ...... load package 'rms' > ddist <- datadist(dfr) > options(datadist='ddist') > n<-100 > set.seed(10) > T.Grade<-factor(0:3,labels=c("G0", "G1", "G2","G3")) > Sex<-factor(sample(0:1, 100, replace=TRUE),labels=c("F","M")) > Smoking<-factor(sample...
2006 Apr 11
1
cph() in Design package
Hi there, I encountered a weird problem using cph() with Design package: I have 2 datasets, say "dat1" and "dat2", both data frames with 3 columns "time","status" and "scores", all numeric If I run the following: dd<-datadist(dat1) options(datadist='dd') dd time status scores Low:effect 37.0 0 -6.018 Adjust to 88.0 0 11.252 High:effect 109.0 1 33.267 Low:prediction 11.0 0 -34.419 High:prediction 147.5 1 88.218 Low 5.0 0...
2010 Jul 31
3
I have a problem
...UE)) # Specify population model for log odds that Y=1 L <- .4*(sex=='male') + .045*(age-50) + (log(cholesterol - 10)-5.2)*(-2*(sex=='female') + 2*(sex=='male')) # Simulate binary y to have Prob(y=1) = 1/[1+exp(-L)] y <- ifelse(runif(n) < plogis(L), 1, 0) ddist <- datadist(age, blood.pressure, cholesterol, sex) options(datadist='ddist') f <- lrm(y ~ lsp(age,50)+sex*rcs(cholesterol,4)+blood.pressure) nom <- nomogram(f, fun=function(x)1/(1+exp(-x)), # or fun=plogis fun.at=c(.001,.01,.05,seq(.1,.9,by=.1),.95,.99,.999), funlabel="Risk of Death") #...
2004 Dec 15
0
Re: [S] using Hmisc and Design library
sorry, I had a typo there, it's datadist(b) for the analysis of data frame "b". --- Robert Balshaw <Robert.Balshaw at syreon.com> wrote: > Not sure if this will help, but did you mean to use > datadist(a) for > the analysis of B? > > Rob > > > -----Original Message----- > > From: r-help-bo...
2007 Oct 02
1
Design package: plot summary
...<-`(`*tmp*`, value = "contr.treatment") : contrasts can be applied only to factors with 2 or more levels I have dichotomous, categorical as well as continuous variables in the model, but I can only plot the dichotomous variable. I started with the following syntax: dd <- datadist(x1, x2, x3) options(datadist='dd') fit<-cph(S~ x1 +x2 +x3, x=T,y=T) plothr<- summary(fit) plot(plothr, log=T) Because the levels defined by datadist didn't seem to work I tried to adjust the levels after fitting the model: dd$limits["Adjust to","x1"] <-...
2006 Feb 08
2
Logistic regression - confidence intervals
...on for the differences in conf intervals achieved via confint.glm (based on profile liklihoods) and the intervals achieved using the Design library. For example, the intervals in the following two outputs are different. library(Design) x = rnorm(100) y = gl(2,50) d = data.frame(x = x, y = y) dd = datadist(d); options(datadist = 'dd') m1 = lrm(y~x, data = d) summary(m1) m2 = glm(y~x, family = binomial, data = d) confint(m2) I have spent time trying to figure this out via archives, but have not had much luck. Regards Stephen
2010 Oct 04
1
I have aproblem about nomogram--thank you for your help
...")) > Sex<-factor(0:1,labels=c("F","M")) > Smoking<-factor(0:1,labels=c("No","yes")) > L<-0.559*as.numeric(T.Grade)-0.896*as.numeric(Smoking)+0.92*as.numeric(Sex)-1.338 > y <- ifelse(runif(n) < plogis(L), 1, 0) > ddist <- datadist(as.numeric(T.Grade,Sex,Smoking)) load package "rms" > ddist <- datadist(as.numeric(T.Grade,Sex,Smoking)) > options(datadist='ddist') > f<-lrm(y~as.numeric(T.Grade)+as.numeric(Sex)+as.numeric(Smoking)) ??? error to:model.frame.default(formula = y ~ as.numeric(T.G...