Thank you all. That helps. I provided "x" as matrix. Actually the data is huge. 
When I work with a small subset of the data the error goes away. Let me try to 
post a reproducible data which can throw the same error.  

Arnab Kumar Maity
Department of Statistics
Texas A&M University
3143 TAMU, Room 401A
College Station, TX 77843
aku...@stat.tamu.edu
+1 779 777 3428

________________________________________
From: David Winsemius <dwinsem...@comcast.net>
Sent: Wednesday, October 19, 2016 3:06 PM
To: Maity, Arnab K
Cc: r-help@r-project.org
Subject: Re: [R] Error message in SIS package

> On Oct 17, 2016, at 1:54 PM, Maity, Arnab K <aku...@stat.tamu.edu> wrote:
>
> I try to run the following code:
>
> sis.fit <- SIS(y = Surv(time = y[, 1], event = y[, 2]), x = x, family = 
> "cox", penalty = "lasso", tune = "cv",
>                 nfolds = 10, type.measure = "deviance", nsis = min(dim(x)), 
> iter = FALSE, seed = 334)
>
> I get the following error:
>
> Error in names(coef.beta) = paste("X", ix1, sep = "") :
>  'names' attribute [1] must be the same length as the vector [0].

You supplied a matrix as an argument to 'x' but the error message is suggesting 
to me that the code was written to expect a list (or dataframe). (On the other 
hand I suppose you could have a matrix accessioned with a length-1 'i' or 'j' 
argument that would return a "named"-vector.)

Reading the help page for SIS, one sees that x was supposed to be a "design 
matrix, of dimensions n * p, without an intercept." I cannot determine whether 
your 'x' argument qualifies as such. Others may be able to determine from the 
circumstantial evidence whether that is possibly the case. Rhelp's posting 
guide suggest that questions about unexpected behavior should be accompanied by 
a discussion that include prior correspondence with the package maintainer as 
well as data ojects from `dump` or `dput` that would allow replication of the 
error.

The code to obtain the maintainer's email address :

maintainer('SIS')

--
David.
>
> here is some information about the data.
>
>> head(y)
>  time status
> 1   24      1
> 2   31      0
> 3   39      0
> 4   64      1
> 5   72      1
> 6    6      0
>> str(y)
> num [1:46, 1:2] 24 31 39 64 72 6 87 17 53 54 ...
> - attr(*, "dimnames")=List of 2
>  ..$ : chr [1:46] "1" "2" "3" "4" ...
>  ..$ : chr [1:2] "time" "status"
>> str(x)
> num [1:46, 1:66] 0.59234 0.30042 0.28278 -0.00966 0.08189 ...
> - attr(*, "dimnames")=List of 2
>  ..$ : chr [1:46] "1" "2" "3" "4" ...
>  ..$ : chr [1:66] "EIF4EBP1" "TP53BP1" "AKT1.AKT2.AKT3" "AR" ...
>> sessionInfo()
> R version 3.3.1 (2016-06-21)
> Platform: x86_64-w64-mingw32/x64 (64-bit)
> Running under: Windows >= 8 x64 (build 9200)
>
> locale:
> [1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United 
> States.1252    LC_MONETARY=English_United States.1252
> [4] LC_NUMERIC=C                           LC_TIME=English_United States.1252
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> other attached packages:
> [1] survival_2.39-4 SIS_0.8-3       glmnet_2.0-5    foreach_1.4.3   
> Matrix_1.2-6
>
> loaded via a namespace (and not attached):
> [1] tools_3.3.1      splines_3.3.1    codetools_0.2-14 grid_3.3.1       
> iterators_1.0.8  ncvreg_3.6-0     lattice_0.20-33
>>
>
> Please help!?
>
>
>
>
> Arnab Kumar Maity
> Department of Statistics
> Texas A&M University
> 3143 TAMU, Room 401A
> College Station, TX 77843
> aku...@stat.tamu.edu<mailto:arnabkrma...@stat.tamu.edu>
> +1 779 777 3428<tel:%2B1%20779%20777%203428>
>
>       [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.

David Winsemius
Alameda, CA, USA


______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Reply via email to