Hi there
Sorry if this is more of a stats question than a Stata question, but grateful for any advice.
My example data is below (using dataex).
I want to see if the number of counts in observation 39 is a significant outlier based on the trend line of observations 1-38. It looks like it should be a clear outlier, but apparently it depends on whether I run the regression assuming a poisson distribution or a negative binomial distribution. The data don't look very dispersed, so I wonder why such a big change in the confidence intervals?
My two alternative commands are:
glm count i.outlier time, eform link(log) family(nbinomial)
glm count i.outlier time, eform link(log) family(poisson)
* Example generated by -dataex-. For more info, type help dataex
clear
input byte(time outlier) double count
1 0 550
2 0 543
3 0 601
4 0 566
5 0 564
6 0 566
7 0 584
8 0 564
9 0 543
10 0 596
11 0 609
12 0 581
13 0 586
14 0 529
15 0 564
16 0 532
17 0 619
18 0 544
19 0 596
20 0 612
21 0 548
22 0 559
23 0 585
24 0 582
25 0 635
26 0 507
27 0 584
28 0 598
29 0 527
30 0 534
31 0 580
32 0 601
33 0 543
34 0 564
35 0 539
36 0 579
37 0 556
38 0 517
39 1 384
end
[/CODE]
Sorry if this is more of a stats question than a Stata question, but grateful for any advice.
My example data is below (using dataex).
I want to see if the number of counts in observation 39 is a significant outlier based on the trend line of observations 1-38. It looks like it should be a clear outlier, but apparently it depends on whether I run the regression assuming a poisson distribution or a negative binomial distribution. The data don't look very dispersed, so I wonder why such a big change in the confidence intervals?
My two alternative commands are:
glm count i.outlier time, eform link(log) family(nbinomial)
glm count i.outlier time, eform link(log) family(poisson)
* Example generated by -dataex-. For more info, type help dataex
clear
input byte(time outlier) double count
1 0 550
2 0 543
3 0 601
4 0 566
5 0 564
6 0 566
7 0 584
8 0 564
9 0 543
10 0 596
11 0 609
12 0 581
13 0 586
14 0 529
15 0 564
16 0 532
17 0 619
18 0 544
19 0 596
20 0 612
21 0 548
22 0 559
23 0 585
24 0 582
25 0 635
26 0 507
27 0 584
28 0 598
29 0 527
30 0 534
31 0 580
32 0 601
33 0 543
34 0 564
35 0 539
36 0 579
37 0 556
38 0 517
39 1 384
end
[/CODE]
Comment