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.
On Apr 27, 2009, at 5:19 PM, mathallan wrote:> > 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?It is very difficult to determine "rightness" since you have omitted essential background information. The most glaring omission is what sort of data is in "sum". If this is either the number of policies or the dollar amount at risk then a categorical "NO" is the answer to the question.>David Winsemius, MD Heritage Laboratories West Hartford, CT
Thanks for the answer David Sum er the "sum insured" the maximal loss of the company. Claims, is the actually claim size. Group is wich type of business is insured. Can you help me to solve the problem? It is very difficult to determine "rightness" since you have omitted essential background information. The most glaring omission is what sort of data is in "sum". If this is either the number of policies or the dollar amount at risk then a categorical "NO" is the answer to the question.>David Winsemius, MD Heritage Laboratories West Hartford, CT ______________________________________________ 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. -- View this message in context: http://www.nabble.com/Generalized-linear-models-tp23265349p23271211.html Sent from the R help mailing list archive at Nabble.com.
I do not answer questions offlist. On Apr 28, 2009, at 2:56 AM, mathallan wrote:> > Thanks for the answer David > > Sum er the "sum insured" the maximal loss of the company. Claims, is > the > actually claim size. Group is wich type of business is insured. > > Can you help me to solve the problem? > > > > It is very difficult to determine "rightness" since you have omitted > essential background information. The most glaring omission is what > sort of data is in "sum". If this is either the number of policies or > the dollar amount at risk then a categorical "NO" is the answer to the > question. >> > > David Winsemius, MD > Heritage Laboratories > West Hartford, CT > > ______________________________________________ > 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. > > > > -- > View this message in context: http://www.nabble.com/Generalized-linear-models-tp23265349p23271211.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > 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.David Winsemius, MD Heritage Laboratories West Hartford, CT