spok
2003-Apr-25 14:45 UTC
[R] validate function in Design library does not work with small samples
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
Frank E Harrell Jr
2003-Apr-25 15:16 UTC
[R] validate function in Design library does not work with small samples
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.stepIn 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
Possibly Parallel Threads
- creating a formula on-the-fly inside a function
- Comparing and Interpreting GAMMs
- Recommended package nlme: bug in predict.lme when an independent variable is a polynomial (PR#8905)
- How to prevent inclusion of intercept in lme with interaction
- GLM and normality of predictors