# st: Re: curious behaviour of -glm-

 From "Martin Weiss" To Subject st: Re: curious behaviour of -glm- Date Thu, 4 Jun 2009 18:44:44 +0200

Which "other Stata commands" are you referring to? One of the most popular ones exits with the same error message (which, BTW, is very clear: GET MORE DATA!)
```
***
clear*

inp x
2
end

reg x
***

HTH
Martin
_______________
```
----- Original Message ----- From: "Mak, Timothy" <timothy.mak07@imperial.ac.uk>
```To: <statalist@hsphsun2.harvard.edu>
Sent: Thursday, June 04, 2009 2:29 PM
Subject: st: curious behaviour of -glm-

```
```Hi list,

```
I'm just curious why -glm, fam(bin) - doesn't seem to handle certain extreme scenarios in accordance with other Stata commands, like give you appropriate warning messages...
```

Eg.

. input r n

r          n

1. 10 100

2. end

. glm r, fam(bin n)

insufficient observations

r(2001);

The model should be estimable...

Also:

. input r n x

r          n          x

1. 10 100 1

2. 0 100 0

3. end

. glm r x, fam(bin n)

Iteration 0:   log likelihood = -2.2079271

Iteration 1:   log likelihood = -2.0261494

Iteration 2:   log likelihood = -2.0259832

Iteration 3:   log likelihood =  -2.025974

Iteration 4:   log likelihood =  -2.025974

```
Generalized linear models No. of obs = 2
```
```
Optimization : ML Residual df = 0
```
```
Scale parameter = 1
```
```
Deviance = 2.00000e-08 (1/df) Deviance = .
```
```
Pearson = 1.00000e-08 (1/df) Pearson = .
```

Variance function: V(u) = u*(1-u/n)                [Binomial]

Link function    : g(u) = ln(u/(n-u))              [Logit]

```
AIC = 4.025974
```
```
Log likelihood = -2.025973987 BIC = 2.00e-08
```

------------------------------------------------------------------------------

|                 OIM

```
r | Coef. Std. Err. z P>|z| [95% Conf. Interval]
```
-------------+----------------------------------------------------------------

```
x | 23.87722 10000 0.00 0.998 -19575.76 19623.52
```
```
_cons | -26.07444 10000 -0.00 0.998 -19625.71 19573.56
```
------------------------------------------------------------------------------

```
The model runs as if there was convergence, but of course there can't be...
```

Tim

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

```
```
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```