[R] Call to glm inside a function

ZABALZA-MEZGHANI Isabelle Isabelle.ZABALZA-MEZGHANI at ifp.fr
Mon Feb 17 14:05:06 CET 2003


Hello,

I want to call glm inside a function. In the first lines of code I build the
weights, the formula, ... and then I call glm with the following command:
    glm(formularesp, data=data, family=familyresp,
weights=eval(data$weights)

My problem is that the fitting proccess is performed just like if
weights=NULL, even if my weights are not equals to 1. I've performed some
return() command before this glm call to check the value of each argument,
and everything seems OK.

Please, help me to understand why the code bypass my weighting instruction.

Regards

Isabelle




More information about the R-help mailing list