[R] help with R semantics

From: Charles Annis, P.E. <Charles.Annis_at_statisticalengineering.com>
Date: Thu, 03 Apr 2008 11:25:17 -0400


Greetings:  

I'm running R2.6.2 on a WinXP DELL box with 2 gig RAM.  

I have created a new glm link function to be used with family = binomial. The function works (although any suggested improvements would be welcome),  

logit.FC <- function(POD.floor = 0, POD.ceiling =1)

{ if (POD.floor < 0 | POD.floor > 1) stop ("POD.floor must be between zero and one.")

    if (POD.ceiling < 0 | POD.ceiling > 1) stop ("POD.ceiling must be between zero and one.")

    if (POD.ceiling - POD.floor < difference.criterion) stop (paste("POD.ceiling-POD.floor difference must be greater than ",difference.criterion," to discourage answer-shopping.", sep=""))

    linkfun <- function(mu) {

    mu <- qlogis( (mu - POD.floor)/(POD.ceiling - POD.floor) )

}

    linkinv <- function(eta) {

    eta <- POD.floor + (POD.ceiling - POD.floor)*plogis(eta)

}

    mu.eta <- function(eta) {

    (POD.ceiling - POD.floor)*dlogis(eta)# derivitaive of mu with respect to eta

}

    valideta <- function(eta) TRUE

    link <- paste("logit.FC(", POD.floor, ",", POD.ceiling, ")", sep = "")

    structure(list(linkfun = linkfun, linkinv = linkinv, mu.eta = mu.eta,

    valideta = valideta, name = link), class = "link-glm")

}  

as is evidenced by the call, binomial(logit.FC(0,1))  

My semantics problem is that I have the name "logit.FC(0,1)", constructed elsewhere using paste(), and I need to remove the quotations in order to use it, since binomial("logit.FC(0,1)") will fail.  

I know I am missing something obvious and would appreciate any help.  

Thanks.  

Charles Annis, P.E.

 <mailto:Charles.Annis_at_StatisticalEngineering.com> Charles.Annis_at_StatisticalEngineering.com phone: 561-352-9699
eFax: 614-455-3265
 <http://www.StatisticalEngineering.com> http://www.StatisticalEngineering.com    

        [[alternative HTML version deleted]]



R-help_at_r-project.org mailing list
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. Received on Thu 03 Apr 2008 - 15:42:27 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 03 Apr 2008 - 17:30:25 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive