# [S] 'glim' and 'glm' covariances

Manfred Wilhelm (wilma@pei.de)
Tue, 14 Jul 1998 16:51:16 +0200

Hallo,

in order to compare three preparations of a quantal bioassy I perform a probit analysis. The matrix X below is designed to yield three different intercepts and a common slope (X[,4] = dilution).
To obtain Fieller's confidence limits for the relative potency I need the covariance parameters of the estimated coefficients.

I used two methods,'glm' and 'glim' in S-PLUS 4.5 for Windows, but got extremley different covariance matrices, while only moderate differences in the coefficients occur. In both cases the dispersion or scale parameter is taken to be 1 (as usual for binomial error or family). Which one is the correct way?
(For perfect confusion: the data are from a worked example in the literature resulting in a third covariance matrix lying in between those of 'glim' and 'glm'.)

Differences seem to be due to a common mulitplicity constant for all covariance parameters. I also recognized that covariance estimates differ by changing the 'wt' or 'weights' arguments. Are the chosen ones not sensible? Do I have to use any scale or dispersion parameter and which one?

> X <- cbind(c(rep(1,4),rep(0,8)),c(rep(0,4),rep(1,4),rep(0,4)),c(rep(0,8),rep(1,4)),log(c(15,7.5,3.75,1.875,10,5,2.5,1.25,32,16,8,4)))

> X
[,1] [,2] [,3] [,4]
[1,] 1 0 0 2.7080502
[2,] 1 0 0 2.0149030
[3,] 1 0 0 1.3217558
[4,] 1 0 0 0.6286087
[5,] 0 1 0 2.3025851
[6,] 0 1 0 1.6094379
[7,] 0 1 0 0.9162907
[8,] 0 1 0 0.2231436
[9,] 0 0 1 3.4657359
[10,] 0 0 1 2.7725887
[11,] 0 0 1 2.0794415
[12,] 0 0 1 1.3862944

> r <- c(9,3,1,0,12,10,6,0,12,11,8,2) # no. of reactive animals
> n <- c(10,11,12,11,12,12,12,10,12,12,12,12) # no. of challenged animals
> p <- r/n

> model.glim_glim(X, y = r, error = "binomial", link = "probit", n = n, wt = n, intercept = F)

> model.glim\$coef
X1 X2 X3 X4
-4.167826 -1.961318 -3.641401 1.910795

> model.glim\$var
[,1] [,2] [,3] [,4]
[1,] 0.03698645 0.016329518 0.02935748 -0.014847039
[2,] 0.01632952 0.014264447 0.01576007 -0.007970386
[3,] 0.02935748 0.015760073 0.03372016 -0.014329291
[4,] -0.01484704 -0.007970386 -0.01432929 0.007246792

> model.glm_glm(p ~ -1 + X, family = binomial(link = probit), weights = n)

> model.glm\$coef
X1 X2 X3 X4
-4.221851 -2.005094 -3.694732 1.937629

> summary(model.glm)\$cov.unscaled
X1 X2 X3 X4
X1 0.4397946 0.1906967 0.3483506 -0.17647000
X2 0.1906967 0.1638209 0.1807388 -0.09156000
X3 0.3483506 0.1807388 0.3955179 -0.16725506
X4 -0.1764700 -0.0915600 -0.1672551 0.08472929

Thanks for any help,

Manfred Wilhelm

_______________________________________

Dr. Manfred Wilhelm
Paul-Ehrlich-Institut (PEI)
Federal Agency for Sera and Vaccines
Paul-Ehrlich-Str. 51-59
D-63225 Langen
Tel: +49 6103 77 2064
Fax: +49 6103 77 1253
Email: wilma@pei.de
Web: www.pei.de
_______________________________________

-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news