Re: [R] method of rpart when response variable is binary?

2007-06-15 Thread Prof Brian Ripley
On Fri, 15 Jun 2007, ronggui wrote: Dear all, I would like to model the relationship between y and x. y is binary variable, and x is a count variable which may be possion-distribution. I think it is better to divide x into intervals and change it to a factor before calling

Re: [R] method of rpart when response variable is binary?

2007-06-15 Thread Wensui Liu
you might use default setting if you use as.factor(y)~x in rpart(), I think. On 6/15/07, ronggui [EMAIL PROTECTED] wrote: Dear all, I would like to model the relationship between y and x. y is binary variable, and x is a count variable which may be possion-distribution. I think it is better

Re: [R] Method dispatch for print() in package its

2007-04-12 Thread Gabor Grothendieck
Without a reproducible example I can't tell what the problem is but as a workaround you could print it as a zoo object: library(its) library(zoo) # create an its object example(its) ii - its(mat, times) # print it without using its' print print(as.zoo(ii)) # or from the command line just

Re: [R] Method dispatch for print() in package its

2007-04-12 Thread Seth Falcon
Albrecht, Dr. Stefan (AZ Private Equity Partner) [EMAIL PROTECTED] writes: Dear all, in the package its the print() method does not seem to correctly work in all circumstances: My understanding is that one should define only a method for the show generic for S4 classes and leave print

Re: [R] Method dispatch for print() in package its

2007-04-12 Thread Prof Brian Ripley
Setting S4 methods for print() works correctly, as in your examples. Your first example does not call print(), so it is not suprising that no method dispatch takes place. You seem to suppose that such a method should be used for top-level auto-printing, and it will not be as your example

Re: [R] Method for selection bias with multinomial treatment

2006-06-18 Thread Barker, Chris [SCIUS]
I don't know of R code per se, but Check papers in the econometric literature by Heckman. And another good recent reference: Stat. Med. 2005 Jul 30;24(14):2197-212. On the use of discrete choice models for causal inference Rusty Tchernis1;?; ?, Marcela Horvitz-Lennon2; 3 and Sharon-Lise T.

Re: [R] Method for $

2005-11-22 Thread Prof Brian Ripley
On Fri, 18 Nov 2005, Ulrike Grömping wrote: From: Duncan Temple Lang [EMAIL PROTECTED] [...] For the record, the problem you are experiencing is that you are not using the same argument names in your method as the function $ uses. Hence there is a mismatch. Use setMethod($,

Re: [R] Method for $

2005-11-22 Thread Ulrike Grömping
Temple Lang [EMAIL PROTECTED], r-help@stat.math.ethz.ch Sent: Tue, 22 Nov 2005 08:39:32 + (GMT) Subject: Re: [R] Method for $ On Fri, 18 Nov 2005, Ulrike Grömping wrote: From: Duncan Temple Lang [EMAIL PROTECTED] [...] For the record, the problem you are experiencing is that you

Re: [R] Method for $

2005-11-21 Thread Tim Hesterberg
Ulrike Groemping [EMAIL PROTECTED] wrote: I have defined a class myclass and would like the slots to be extractable not only by @ but also by $. I now try to write a method for $ that simply executes the request [EMAIL PROTECTED], whenever someone calls object$slotname for any object of class

Re: [R] Method for $

2005-11-18 Thread Uwe Ligges
Ulrike Grömping wrote: Dear R experts, I have defined a class myclass and would like the slots to be extractable not only by @ but also by $. I now try to write a method for $ that simply executes the request [EMAIL PROTECTED], whenever someone calls object$slotname for any object of

Re: [R] Method for $

2005-11-18 Thread Martin Maechler
Ulrike == Ulrike Grömping [EMAIL PROTECTED] on Fri, 18 Nov 2005 15:37:58 +0100 writes: Ulrike Dear R experts, Ulrike I have defined a class myclass and would like the Ulrike slots to be extractable not only by @ but also by $. hmm, I know this is not what you've asked for, but

Re: [R] Method for $

2005-11-18 Thread Ulrike Grömping
, Ulrike Grömping -- Original Message --- From: Uwe Ligges [EMAIL PROTECTED] To: Ulrike Grömping [EMAIL PROTECTED] Cc: r-help@stat.math.ethz.ch Sent: Fri, 18 Nov 2005 17:45:40 +0100 Subject: Re: [R] Method for $ Ulrike Grömping wrote: Dear R experts, I have defined

Re: [R] Method for $

2005-11-18 Thread Berton Gunter
: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Uwe Ligges Sent: Friday, November 18, 2005 8:46 AM To: Ulrike Grömping Cc: r-help@stat.math.ethz.ch Subject: Re: [R] Method for $ Ulrike Grömping wrote: Dear R experts, I have defined a class myclass and would like the slots

Re: [R] Method for $

2005-11-18 Thread Ulrike Grömping
Grömping [EMAIL PROTECTED] Cc: r-help@stat.math.ethz.ch Sent: Fri, 18 Nov 2005 18:29:27 +0100 Subject: Re: [R] Method for $ Ulrike == Ulrike Grömping [EMAIL PROTECTED]     on Fri, 18 Nov 2005 15:37:58 +0100 writes:    Ulrike Dear R experts,    Ulrike I have defined a class myclass

Re: [R] Method for $

2005-11-18 Thread Duncan Temple Lang
Grömping [EMAIL PROTECTED] Cc: r-help@stat.math.ethz.ch Sent: Fri, 18 Nov 2005 17:45:40 +0100 Subject: Re: [R] Method for $ Ulrike Grömping wrote: Dear R experts, I have defined a class myclass and would like the slots to be extractable not only by @ but also by $. I now try

Re: [R] Method for $

2005-11-18 Thread Ulrike Grömping
-- Original Message --- From: Duncan Temple Lang [EMAIL PROTECTED] To: Ulrike Grömping [EMAIL PROTECTED] Cc: Uwe Ligges [EMAIL PROTECTED], r-help@stat.math.ethz.ch Sent: Fri, 18 Nov 2005 10:26:51 -0800 Subject: Re: [R] Method for $ -BEGIN PGP SIGNED MESSAGE- Hash

Re: [R] Method for $

2005-11-18 Thread Ulrike Grömping
PROTECTED], 'Ulrike Grömping' [EMAIL PROTECTED] Cc: r-help@stat.math.ethz.ch Sent: Fri, 18 Nov 2005 09:42:12 -0800 Subject: RE: [R] Method for $ I believe that a  recommended S4 convention is simply to write methods for slot extraction with the same name as the slot. Thus, for an object,x

Re: [R] method names conflict.

2003-11-21 Thread Roger D. Peng
If you are using S4 classes/methods you can just do setGeneric(union) and that converts union() into an S4 generic function. Then you can use setMethod() to create a union() method for your own objects. I think the original union() in the base package because the default method. -roger

RE: [R] method names conflict.

2003-11-21 Thread Simon Fear
There is nothing to stop you using these names, you just need to be aware that you would be hiding the base definitions. Though these could always be accessed using the double colon operator, e.g. base::subset, you might indeed get very unexpected results if some function called subset()

Re: [R] Method of L-BFGS-B of optim evaluate function outside of boxconstraints

2003-08-21 Thread Adelchi Azzalini
On Wednesday 20 August 2003 15:44, Shengqiao Li wrote: Hi, R guys: I'm using L-BFGS-B method of optim for minimization problem. My function called besselI function which need non-negative parameter and the besselI will overflow if the parameter is too large. So I set the constraint box which

Re: [R] Method of L-BFGS-B of optim evaluate function outside ofbox constraints

2003-08-21 Thread Shengqiao Li
Thanks. log.arg worked to make sure nonnegative value. But the other side is overflow. Beyond the upper limit, the exp(arg) is large and bessel overflows even if exponentially scaled one is used. This will happen at 1/500 chance. Due to I'm doing 10,000 simulations, this problem blocked me.

Re: [R] Method of L-BFGS-B of optim evaluate function outside ofbox constraints

2003-08-21 Thread Shengqiao Li
Hope this bug will be fixed in the future. Li On Wednesday 20 August 2003 15:44, Shengqiao Li wrote: Hi, R guys: I'm using L-BFGS-B method of optim for minimization problem. My function called besselI function which need non-negative parameter and the besselI will overflow if the

Re: [R] Method of L-BFGS-B of optim evaluate function outside ofbox constraints

2003-08-20 Thread Spencer Graves
I see two problems, which I handle differently: First, if arg must be nonnegative, I program fn in terms of log.arg, so it can never become nonpositive. Second, is besselI always positive? If yes, then program fn to compute log(besselI) and use that. Standard references such as

Re: [R] Method 'EvaluateNoReturn' of object 'IStatConnector' failed

2003-07-19 Thread Prof Brian Ripley
On Sat, 19 Jul 2003, Neil Osborne wrote: I am using the R ActiveX component (v1.2). I have written a custom function in R which returns a dataframe. I want to be able to retrieve the contents of the returned dataframe in my application. Here is a snippet of the code (line that throws