[R] error in summary.Design

From: DAVID ARTETA GARCIA <darteta001_at_ikasle.ehu.es>
Date: Mon, 28 Apr 2008 14:29:19 +0200


Dear list,

after fitting an lrm with the Design package (stored as "mymodel") I try running a summary, but I get the following error:

dim(mydata)
[1] 235 9

names(mydata)
  [1] "id" "VAR1" "VAR2" "VAR3" "VAR4" "VAR5" "VAR6" "VAR7" "VAR8"

summary(mymodel)
Error in `contrasts<-`(`*tmp*`, value = "contr.treatment") :

   contrasts can be applied only to factors with 2 or more levels

but,

VAR1 is my dependent
> nlevels(factor(VAR1))

[1] 2

VAR2 is continuous
> summary(psa)

    Min. 1st Qu. Median Mean 3rd Qu. Max.     0.90 6.05 8.40 10.99 13.15 59.70

and for the remaining variables...

> nlevels(factor(VAR3))

[1] 2
> nlevels(factor(VAR4))

[1] 2
> nlevels(factor(VAR5))

[1] 3
> nlevels(factor(VAR6))

[1] 2
> nlevels(factor(VAR7))

[1] 2
> nlevels(factor(VAR8))

[1] 2

What I am missing?

Thanks in advance,

David



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Mon 28 Apr 2008 - 12:32:26 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 28 Apr 2008 - 18:30:32 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive