[R] Re: brlr function

Min-Han Tan minhan.science at gmail.com
Thu Aug 26 03:31:43 CEST 2004


Thank you all. 

The reason was because the dependent should have been 0 and 1, rather
than 1 and 2!

Apologies for any trouble.

Min-Han


On Wed, 25 Aug 2004 18:40:38 -0400, Min-Han Tan
<minhan.science at gmail.com> wrote:
> Hi,
> 
> I'm trying the brlr function in a penalized logistic regression function.
> 
> However, I am not sure why I am encountering errors. I hope to seek
> your advice here. (output below)
> 
> Thank you! Your help is truly appreciated.
> 
> Min-Han
> 
> #No error here, the glm seems to work fine
> > genes.cox1.glm1<-glm(as.formula(paste(paste('as.integer(sim.cv.cox.yhat1)~'),paste('sim.dat.tst[',genes.cox1.rows,',]',sep="",collapse='+'))))
> 
> #Something happened here ... I only substituted brlr for glm
> > genes.cox1.glm1<-brlr(as.formula(paste(paste('as.integer(sim.cv.cox.yhat1)~'),paste('sim.dat.tst[',genes.cox1.rows,',]',sep="",collapse='+'))))
> Error in eval(expr, envir, enclos) : y values must be 0 <= y <= 1
> 
> #using the test data in brlr gives the same error if the dependent is
> reduced to one column, is it a problem with my dependent? It works
> fine as per the original vignette with
> brlr(cbind(grahami,opalinus)~height ...)
> > brlr(grahami~height+diameter,data=lizards)
> Error in eval(expr, envir, enclos) : y values must be 0 <= y <= 1
> 
> #This is how the objects look
> > as.integer(sim.cv.cox.yhat1)
> [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 2 2 2 1 1 2 2 1 1 1 2 1 2 2 2
> 1 2 1 1 2 1 1 2 1 1 1 2 2 2 2
> 
> > as.formula(paste(paste('as.integer(sim.cv.cox.yhat1)~'),paste('sim.dat.tst[',genes.cox1.rows,',]',sep="",collapse='+')))
> as.integer(sim.cv.cox.yhat1) ~ sim.dat.tst[27, ] + sim.dat.tst[35,
>    ] + sim.dat.tst[17, ] + sim.dat.tst[41, ] + sim.dat.tst[38,
>    ] + sim.dat.tst[31, ] + sim.dat.tst[3, ] + sim.dat.tst[32,
>    ] + sim.dat.tst[16, ] + sim.dat.tst[48, ] + sim.dat.tst[13,
>    ] + sim.dat.tst[28, ]
> 
> > sim.dat.tst[27,]
> Sample 1  Sample 2  Sample 3  Sample 4  Sample 5  Sample 6  Sample 7
> Sample 8  Sample 9 Sample 10 Sample 11 Sample 12 Sample 13 Sample 14
> Sample 15
>     5.79      6.72      6.11      5.58      6.32      6.50      6.45
>    5.77      7.46      6.32      5.64      5.77      5.44      5.83
>   5.57
> Sample 16 Sample 17 Sample 18 Sample 19 Sample 20 Sample 21 Sample 22
> Sample 23 Sample 24 Sample 25 Sample 26 Sample 27 Sample 28 Sample 29
> Sample 30
>     5.70      5.67      5.72      5.50      6.34      5.98      6.10
>    6.25      6.13      7.40      7.28      8.37      5.73      6.83
>   5.72
> Sample 31 Sample 32 Sample 33 Sample 34 Sample 35 Sample 36 Sample 37
> Sample 38 Sample 39 Sample 40 Sample 41 Sample 42 Sample 43 Sample 44
> Sample 45
>     6.12      6.74      6.64      6.13      7.74      6.70      7.37
>    6.54      6.49      5.75      6.18      6.41      7.68      5.36
>   6.34
> Sample 46 Sample 47 Sample 48
>     5.86      6.64      6.69
>




More information about the R-help mailing list