[R] GLM question
Gesmann, Markus
Markus.Gesmann at lloyds.com
Tue May 31 15:54:40 CEST 2005
It appears that you try to do some insurance reserving analysis.
Have a look at http://finzi.psych.upenn.edu/R/Rhelp02a/archive/15315.html, this might be helpful.
Regards
Markus
-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Laetitia Mestdagh
Sent: 31 May 2005 14:44
To: r-help at stat.math.ethz.ch
Subject: [R] GLM question
I am unfamiliar with R and I'm trying to do few statistical things like GLM and GAM with it. I hope my following questions will be clear enough:
My datas ( y(i,j ))are run off triangles for example :
J=1
J=2
J=3
I=1
1
2
3
I=2
4
5
I=3
6
My model is :
E[y(i,j)] =m(i,j)
Var[y(i,j)] =constant *m(i,j)
Log(m(i,j)) = eta (i,j)
eta (i,j) = c + alpha(i) + beta(j)
The y(i,j) are the response and they have no specified distribution.
Here is what I did and I'm not getting the right results:
> y1<-c(1,0,0,0,0)
> y2<-c(1,0,0,1,0)
> y3<-c(1,0,0,0,1)
> y4<-c(1,1,0,0,0)
> y5<-c(1,1,0,1,0)
> y6<-c(1,0,1,0,0)
> C<-matrix(nrow = 6, ncol = 5, byrow= TRUE)
> C[1,]<-y1
> C[2,]<-y2
> C[3,]<-y3
> C[4,]<-y4
> C[5,]<-y5
> C[6,]<-x6
> m<-c(1,2,3,4,5,6)
> Cdata<-data.frame(C[,1],C[,2],C[,3],C[,4],C[,5])
>fmp<-glm(m~C,family = quasipoisson(link = log),data=Cdata)
> fitted.values(fmp)
1 2 3 4 5 6
1.25 1.75 3.00 3.75 5.25 6.00
So my question are : - Why are the fitted wrong (except for 3 and 6)?
- Is the quasipoisson the right family for my model?
I am a little bit lost and not an expert of R, so I thank in advance for any kind of advice
Laetitia
---------------------------------
ils, photos et vidéos !
[[alternative HTML version deleted]]
______________________________________________
R-help at stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
************LNSCNTMCS01***************************************************
The information in this E-Mail and in any attachments is CON...{{dropped}}
More information about the R-help
mailing list