[R] validate function in Design library does not work with small samples

Frank E Harrell Jr fharrell at virginia.edu
Fri Apr 25 17:16:25 CEST 2003


On Fri, 25 Apr 2003 07:45:16 -0700 (PDT)
spok <spok_1 at yahoo.com> wrote:

> Hi,
> 
> I am using the validate function in the design library
> to get corrected Somer's Dxy for cox ph models.  When
> my sample size is reduced from 300 to 150, the
> function complains (length of dimnames[1] not equal to
> array) and does not produce any results.  There are no
> missing values in the data.  Any suggestions for a
> work-around?
> 
> Thank you in Advance.
> 
> >
> f.total=cph(Surv(fu,censor)~predictor+pred2+pred3,data=data,x=T,y=T,surv=T)
> > set.seed(6)
> > val.step=validate(f.total,B=155,bw=T)
> 
>                 Backwards Step-down - Original Model
> 
> No Factors Deleted
> 
> Factors in Final Model
> 
> [1] pred2
> .Random.seed: 1 -1021164091 1170333634 in .GlobalEnv 
> Iteration:
> 1 2 3 4 5 6 7 Error in fit(NULL, y[train, , drop =
> FALSE], iter = i, tol = tol, ...) : 
>         length of dimnames[1] not equal to array
> extent
> > val.step

In general it is best to contact the package maintainer directly.  Also, be sure to give the output of typing the command 

  version

and the version number of the package you are using.  For your problem please run save( ) to save f.total and e-mail it to me as an attachment, then I'll debug.  I'm glad you issued the set.seed command which should help me replicate the problem.

Frank

---
Frank E Harrell Jr              Prof. of Biostatistics & Statistics
Div. of Biostatistics & Epidem. Dept. of Health Evaluation Sciences
U. Virginia School of Medicine  http://hesweb1.med.virginia.edu/biostat



More information about the R-help mailing list