[R] Automating regression
gunter.berton at gene.com
Tue Dec 23 00:12:19 CET 2014
.. that should have been either
myProc <- function(FUN, ...) do.call(FUN,list(...))
myProc <- function(FUN, ...) FUN(...)
My other comments still apply.
Genentech Nonclinical Biostatistics
"Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom."
On Mon, Dec 22, 2014 at 3:08 PM, Bert Gunter <bgunter at gene.com> wrote:
> "Automate" is vague and ill-defined. But perhaps ?do.call is what
> you're looking for; e.g.
> myProc <- function(FUN, ...) do.call(FUN,...)
> This is one of the cool things about functional type programming --
> you can pass functions as arguments.
> If this is not it, maybe someone else will groc what you mean -- or
> you could define yourself more clearly.
> Bert Gunter
> Genentech Nonclinical Biostatistics
> (650) 467-7374
> "Data is not information. Information is not knowledge. And knowledge
> is certainly not wisdom."
> Clifford Stoll
> On Mon, Dec 22, 2014 at 2:53 PM, Steven Yen <syen04 at gmail.com> wrote:
>> How do I specify the type of regression in calling a procedure/
>> In the following I call the procedure to do a probit regression. Of course,
>> I can change "probit" into "lm" in procedure "myreg" to do a linear
>> My question is, how do I automate this (choice of lm or probit) in calling
>> "myreg", with a proper input (e.g., model=lm)? Thank you.
>> b<-myreg(eq1,data=mydata); summary(b)
>> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help