
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]]


