Displaying 20 results from an estimated 29 matches for "ddist".
Did you mean:
dist
2010 Oct 04
2
i have aproblem --thank you
...to :complete.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<...
2011 Apr 12
1
Datadist error
...gistic 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 convert my original dataset to
datadistL
d<-datadist(d)
options(datadist="d")
After this I can perform all the diagnostics and make a nomogram. Howe...
2010 Jul 31
3
I have a problem
...'), n,TRUE))
# 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...
2003 Nov 04
2
help with nomogram function
...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:prediction 80 right
Low...
2010 Oct 04
1
I have aproblem about nomogram--thank you for your help
...ot;,"G3"))
> 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 ~...
2009 Nov 14
1
setting contrasts for a logistic regression
Hi everyone,
I'm doing a logistic regression with an ordinal variable. I'd like to set
the contrasts on the ordinal variable. However, when I set the contrasts,
they work for ordinary linear regression (lm), but not logistic regression
(lrm):
ddist = datadist(bin.time, exp.loc)
options(datadist='ddist')
contrasts(exp.loc) = contr.treatment(3, base = 3, contrasts = TRUE)
lrm.loc = lrm(bin.time ~ exp.loc, data = Dataset)
In this case, lrm still uses exp.loc = 1 as the base, at least in terms of
notation, even though I set exp.loc = 3 a...
2010 Oct 04
0
2010年10月4日 19:14:45 自动保存草稿
...to :complete.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<...
2010 Oct 04
0
have aproblem --thank you
....(???error to :complete.cases(x, y, wt) : ???????????(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<...
2011 Jun 23
2
Rms package - problems with fit.mult.impute
...e 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+Age+Ward+Sex, n.impute=20, nk=0,data=med.err)
ddist<-datadist(Age,No.drugs,Days.categ, Sex, Living, Ward)
options(datadist="ddist")
fmi<-fit.mult.impute(med.hist.err~Age+No.drugs+Days.categ+Sex+Living+Ward, fitter=lrm, x=T, y=T,a,data=med.err)
Error in 1:n.impute : NA/NaN argument
In addition: Warning message:
In 1:n.impute : numeri...
2018 Jan 03
1
summary.rms help
...;mmHg'
# 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')
fit <- lrm(y ~ blood.pressure + sex * (age + rcs(cholesterol,4)))
s <- summary(fit)
plot(s)
as you will see the plot will by default include the low and high values from the summary printed on the plot...
2007 Mar 21
1
how to get "lsmeans"?
...(factors); d is a continuous variable ;
The response variable Y is a continuous variable too.
To get lsmeans of Y according to A,B and C, respectively, in SAS, I tried
proc glm data=a;
class A B C;
model Y=A B C d;
lsmeans A B C/cl;
run;
In R, I tried this:
library(Design)
ddist<-datadist(a)
options(datadist="ddist")
f<-ols(Y~A+B+C+D,data=a,x=TRUE,y=TRUE,se.fit=TRUE)
then how to get the "lsmeans" for A, B, and C, respectively with predict function?
Best wishes
yours, sincerely
Xingwang Ye
PhD candidate
Research Group of Nut...
2010 Feb 17
1
strangeness in Predict() {rms}
Hi,
Running the following example from ?Predict() throws an error I have never
seen before:
set.seed(1)
x1 <- runif(300)
x2 <- runif(300)
ddist <- datadist(x1,x2); options(datadist='ddist')
y <- exp(x1+ x2 - 1 + rnorm(300))
f <- ols(log(y) ~ pol(x1,2) + x2)
p1 <- Predict(f, x1=., conf.type='mean')
Error in paste(nmc[i], "=", if (is.numeric(x)) format(x) else x, sep = "") :
cannot coerce...
2013 Jun 24
2
Nomogram (rms) for model with shrunk coefficients
...he model and 'shrunk' the
regression coefficients and computed a new intercept, how can I build a
nomogram using that object? Please see the simplified code for details:
library(rms)
x1<-rnorm(100,1,1)
x2<-rnorm(100,1,1)
y<-rbinom(100,1,0.5)
d<-data.frame(x1,x2,y)
attach(d)
ddist<-datadist(d)
options(datadist='ddist')
model<-lrm(y~x1+x2, x=TRUE, y=TRUE, data=d)
plot(nomogram(model))
##Nomogram is printed, as expected
##Now the model is internally validated, and regression coefficients are
penalized
bootstrap<-validate(model, bw=FALSE, B=100)
shrinkage<...
2002 Sep 13
1
design package (plot problems)
...ecify 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')
$
$ fit <- lrm(y ~ blood.pressure + sex * (age + rcs(cholesterol,4)),x=T, y=T)
$
$ par(mfrow=c(2,2))
$ plot(fit) # Plot effects of all 4 predictors
Error in "oldClass<-"(*tmp*,...
2008 May 29
2
Troubles plotting lrm output in Design Library
...pulation 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')
>
> 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
E...
2005 Aug 22
1
How to add legend of plot.Design function (method=image)? (if (!.R.) )
...l 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 bin
ary 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)
boundaries <- perimeter(age, cholesterol, lowess=TRUE)
plot(age, cholester...
2017 Sep 14
3
Help understanding why glm and lrm.fit runs with my data, but lrm does not
...var.labels=c(DAY30="30-day Mortality", AGE="Age in Years", KILLIP="Killip Class", HYP="Hypertension", HRT="Tachycardia", ANT="Anterior Infarct Location")
label(gusto2)=lapply(names(var.labels),function(x) label(gusto2[,x])=var.labels[x])
ddist = datadist(gusto2)
options(datadist='ddist')
fit1 <- lrm(DAY30~AGE+HYP+KILLIP+HRT+ANT,gusto2)
Error in lrm(DAY30 ~ AGE + HYP + KILLIP + HRT + ANT, gusto2) :
Unable to fit model using "lrm.fit"
Online solutions to this problem involve checking whether any variables are redu...
2010 Aug 14
1
How to add lines to lattice plot produced by rms::bplot
...9;mmHg'
# 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')
fit <- lrm(y ~ blood.pressure + sex * (age + rcs(cholesterol,4)),
x=TRUE, y=TRUE)
p <- Predict(fit, age, cholesterol, sex='male', np=50) # vary sex last
bp.plot <- bplot(p, lfun...
2017 Sep 14
0
Help understanding why glm and lrm.fit runs with my data, but lrm does not
...AY30="30-day Mortality", AGE="Age in Years", KILLIP="Killip Class", HYP="Hypertension", HRT="Tachycardia", ANT="Anterior Infarct Location")
> label(gusto2)=lapply(names(var.labels),function(x) label(gusto2[,x])=var.labels[x])
>
> ddist = datadist(gusto2)
> options(datadist='ddist')
>
> fit1 <- lrm(DAY30~AGE+HYP+KILLIP+HRT+ANT,gusto2)
>
> Error in lrm(DAY30 ~ AGE + HYP + KILLIP + HRT + ANT, gusto2) :
> Unable to fit model using "lrm.fit"
>
> Online solutions to this problem involve...
2005 Aug 22
0
How to add legend of plot.Design function ( method=image)?
...l 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 bin
ary 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)
boundaries <- perimeter(age, cholesterol, lowess=TRUE)
plot(age, cholester...