[R]: GLIM PROBLEMS

Peter Dalgaard p.dalgaard at biostat.ku.dk
Tue Dec 2 10:22:14 CET 2003


allan clark <allan at stats.uct.ac.za> writes:

>    Hi all
> 
>    I have another GLIM question.
> 
>    I have been using R as well as Genstat (version 6) in order to fit
>    GLIM models to the data (displayed below).
> 
>    The same models are fitted but the answers supplied by the two
>    packages are not the same.
> 
>    Why? Can anyone help?

It's not the same model!
....

>    cars<-read.table("c:/a.dat",header=T)
>    attach(cars)
>    y<-cbind(claims.r,exp.n)
        *********************

from help(glm)

     For 'binomial' models the response can also be specified as a
     'factor' (when the first level denotes failure and all others
     success) or as a two-column matrix with the columns giving the
     numbers of successes and failures.      


>    cars.age<-glm(y~age,family=binomial)
>    summary(cars.age)

....

>    ***** Regression Analysis *****
> 
>    Response variate: claims_r
>    Binomial totals: exp_n
              ******

>    Distribution: Binomial
>    Link function: Logit
>    Fitted terms: Constant, age


I.e. try  y <- cbind(claims.r, exp.n - claims.r)

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907




More information about the R-help mailing list