[R] GLM question

From: Laetitia Mestdagh <laet_99_at_yahoo.fr>
Date: Tue 31 May 2005 - 23:43:43 EST

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)?

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@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 Received on Tue May 31 23:49:01 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:16 EST