Re: [R] GML with tweedie: AIC=NA

2007-08-14 Thread Gordon Smyth
er, after running the tweedie.R file from that package source >I am able to use the dtweedie() function, but still I didn't figure >out a way to do the step (or to get the AIC from the glm command). > >Thank you again for your help; > >Catarina > > >On 13/08/07

Re: [R] GML with tweedie: AIC=NA

2007-08-13 Thread Gordon Smyth
Dear Catarina, I prefer to leave the AIC value as NA for the tweedie GLM family because it takes extra time to compute and is only occasionally wanted. It's easy to compute the AIC yourself using the dtweedie() function of the tweedie package. Best wishes Gordon At 03:05 AM 14/08/2007, Catari

[R] Sorting the levels of a factor

2007-07-03 Thread Gordon Smyth
; > > unique(targets$Class) >[1] NormalTumor Tumor_CN Normal_CN >Levels: Normal Normal_CN Tumor Tumor_CN > > levels(unique(targets$Class)) >[1] "Normal""Normal_CN" "Tumor" "Tumor_CN" > > > >-Ori

[R] using trace() on S4 coerce method

2004-05-13 Thread Gordon Smyth
I'm trying to use trace() on an S4 coerce method, but get the error Error in bindingIsLocked(what, whereM) : no binding for "coerce" What am I doing wrong? Example code follows. (I've googled the R mailing lists for "trace coerce" and "trace bindingisLocked" without finding anything relevant

Re: [R] Test for pre-existing Win menu or item

2004-02-17 Thread Gordon Smyth
Many thanks to Hadley Wickham for pointing out that my question had already been answered on the R-help list in December, see https://www.stat.math.ethz.ch/pipermail/r-help/2003-December/041786.html or http://maths.newcastle.edu.au/~rking/R/help/03b/7525.html and to Jeff Gentry for pointing out t

[R] Test for pre-existing Win menu or item

2004-02-17 Thread Gordon Smyth
Before using winMenuAdd(), is it possible to test whether the menu already exists? One could use try(winMenuAddItem()) with appropriate arguments, but is there anything more elegant? Many thanks Gordon __ [EMAIL PROTECTED] mailing list https://www.stat

Re: [R] cross-classified random factors in lme without blocking - success

2003-11-22 Thread Gordon Smyth
gma.res) > fm <- lme(y~1,random=list(u=pdBlocked(list(pdIdent(~a-1),pdIdent(~b-1) > v <- sqrt(diag(as.matrix(fm$modelStruct$reStruct$u))[c(1,na+1)]) > v <- fm$sigma * c(v, 1) > names(v) <- c("Sigma.a","Sigma.b","Sigma.res") > print(v) Sigma

Re: [R] cross-classified random factors in lme without blocking

2003-11-14 Thread Gordon Smyth
Many thanks for help from Peter Dalgaard, Douglas Bates and Bill Venables. As a result of their help, here is a working example of using lme to fit an additive random effects model. The model here is effectively y~a+b with a and b random: y <- rnorm(12) a <- gl(4,1,12) b <- gl(3,4,12) u <- gl(1

[R] cross-classified random factors in lme without blocking

2003-10-31 Thread Gordon Smyth
On page 165 of Mixed-Effects Models in S and S-Plus by Pinheiro and Bates there is an example of using lme() in the nlme package to fit a model with crossed random factors. The example assumes though that the data is grouped. Is it possible to use lme() to fit crossed random factors when the da

[R] is.empty for formal class object

2003-02-28 Thread Gordon Smyth
I'd like to construct a function is.empty(x) which would work on arbitrary objects, and would tell me whether the object contains any data. I think that I can write a function which will recurse down through all the slots of x (and slots of slots) until it reaches objects of elementary type (NU

Re: [R] Rcmd check does not recognize formal generic function as code object

2003-02-22 Thread Gordon Smyth
At 04:16 PM 19/02/2003, Robert Gentleman wrote: It was decided that should not be an error to omit documentation for a generic function defined in a package (whose sole purpose is to extend a current function to be generic). It appears that the implementation of that decision was to treat a

Re: [R] Rcmd check does not recognize formal generic function as code object

2003-02-19 Thread Gordon Smyth
word{models} --- Regards Gordon At 04:16 PM 19/02/2003, you wrote: On Wed, Feb 19, 2003 at 03:44:31PM +1100, Gordon Smyth wrote: > Dear all, > > I am trying to write a package using formal methods and classes from the > methods package. I have not been able to get the package to pass rcmd c

[R] Rcmd check does not recognize formal generic function as codeobject

2003-02-18 Thread Gordon Smyth
Dear all, I am trying to write a package using formal methods and classes from the methods package. I have not been able to get the package to pass rcmd check without warnings, because rcmd check does not recognize my generic functions as code objects and therefore queries why they have documen

[R] a fit method for gls?

2003-01-13 Thread Gordon Smyth
Dear all, I make extensive use of the gls function from the nlme library for microarray data analysis (details described in http://bioinf.wehi.edu.au/smawehi/library/smawehi/html/gls.series.html). A typical fit involves running gls about 15000 times with the same formula, with different repon