[R] Generalized linear models

mathallan mathanmath at gmail.com
Mon Apr 27 23:19:53 CEST 2009


I have to fit a generalized linear model in R, and I have never done this
before, so I'm in very much doubt.

I have a dataset (of 4036 observations)

  claims	      sum	              grp
1	3852	      34570293	          1
2	1194	      7776468	            1
3	3916	      26343305          1
4	1258	      5502915	           1
5	11594	    711453346	        1
...

there are 4 groups (grp).

The task is to determine the effect of sum and grp (and interactions between
them) on the claims.

I have to test using different link functions and distributions


What I think I should do is (in R)

> glm(claims~sum*grp, family=gaussian(link="log"))

Call:  glm(formula = claims ~ sum * grp, family = gaussian(link = "log")) 

Coefficients:
(Intercept)          sum          grp      sum:grp  
  1.215e+01   -4.466e-09    6.814e-02    5.294e-09  

Degrees of Freedom: 4035 Total (i.e. Null);  4032 Residual
Null Deviance:      3.371e+16 
Residual Deviance: 3.355e+16    AIC: 131500 


Is this right? And how can the output be interpreted?

Did I even answer the question, and how can I plot a curve to the
oberservations?


/Thank you so much for helping


-- 
View this message in context: http://www.nabble.com/Generalized-linear-models-tp23265349p23265349.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list