aout.nbinom: Find alpha-outliers in negative Binomial data

Description Usage Arguments Value Author(s) See Also Examples

View source: R/aout.nbinom.R

Description

Given the parameters of a negative Binomial distribution, aout.nbinom identifies α-outliers in a given data set.

Usage

1
aout.nbinom(data, param, alpha = 0.1, hide.outliers = FALSE)

Arguments

data

a vector. The data set to be examined.

param

a vector. Contains the parameters of the negative Binomial distribution: N, p.

alpha

an atomic vector. Determines the maximum amount of probability mass the outlier region may contain. Defaults to 0.1.

hide.outliers

boolean. Returns the outlier-free data if set to TRUE. Defaults to FALSE.

Value

Data frame of the input data and an index named is.outlier that flags the outliers with TRUE. If hide.outliers is set to TRUE, a simple vector of the outlier-free data.

Author(s)

A. Rehage

See Also

dnbinom, daysabs

Examples

1
2
data(daysabs)
aout.nbinom(daysabs, c(8, 0.6), 0.05)

Example output

Loading required package: Rsolnp
Loading required package: nleqslv
Loading required package: quantreg
Loading required package: SparseM

Attaching package: 'SparseM'

The following object is masked from 'package:base':

    backsolve

    data is.outlier
1      4      FALSE
2      4      FALSE
3      2      FALSE
4      3      FALSE
5      3      FALSE
6     13       TRUE
7     11      FALSE
8      7      FALSE
9     10      FALSE
10     9      FALSE
11     4      FALSE
12     5      FALSE
13     5      FALSE
14     6      FALSE
15     1      FALSE
16     0      FALSE
17     1      FALSE
18     0      FALSE
19     5      FALSE
20    24       TRUE
21     2      FALSE
22     0      FALSE
23     1      FALSE
24     0      FALSE
25     8      FALSE
26     6      FALSE
27     7      FALSE
28     0      FALSE
29     2      FALSE
30     3      FALSE
31     0      FALSE
32     1      FALSE
33     3      FALSE
34     0      FALSE
35     0      FALSE
36    28       TRUE
37     8      FALSE
38     5      FALSE
39     5      FALSE
40    27       TRUE
41     5      FALSE
42    18       TRUE
43    19       TRUE
44     9      FALSE
45     9      FALSE
46     4      FALSE
47     2      FALSE
48     3      FALSE
49     9      FALSE
50    20       TRUE
51     6      FALSE
52     0      FALSE
53    27       TRUE
54    12       TRUE
55    34       TRUE
56     1      FALSE
57    28       TRUE
58     8      FALSE
59     3      FALSE
60     2      FALSE
61     1      FALSE
62     7      FALSE
63     4      FALSE
64     8      FALSE
65     6      FALSE
66    16       TRUE
67     6      FALSE
68     4      FALSE
69     3      FALSE
70     5      FALSE
71     0      FALSE
72     9      FALSE
73     0      FALSE
74     8      FALSE
75     0      FALSE
76    14       TRUE
77     4      FALSE
78     2      FALSE
79    35       TRUE
80    23       TRUE
81    13       TRUE
82     6      FALSE
83     3      FALSE
84     6      FALSE
85     0      FALSE
86    11      FALSE
87    11      FALSE
88    11      FALSE
89     4      FALSE
90     6      FALSE
91    23       TRUE
92     5      FALSE
93     5      FALSE
94    29       TRUE
95     7      FALSE
96     1      FALSE
97     9      FALSE
98    11      FALSE
99    18       TRUE
100   12       TRUE
101    6      FALSE
102    0      FALSE
103    4      FALSE
104   10      FALSE
105   19       TRUE
106    1      FALSE
107   12       TRUE
108    3      FALSE
109    0      FALSE
110    9      FALSE
111   14       TRUE
112    7      FALSE
113    3      FALSE
114   10      FALSE
115   12       TRUE
116    6      FALSE
117   35       TRUE
118   16       TRUE
119    3      FALSE
120   10      FALSE
121    6      FALSE
122    3      FALSE
123    2      FALSE
124    6      FALSE
125    5      FALSE
126   13       TRUE
127    7      FALSE
128    5      FALSE
129    3      FALSE
130   30       TRUE
131   16       TRUE
132   15       TRUE
133   12       TRUE
134    1      FALSE
135    4      FALSE
136    7      FALSE
137    1      FALSE
138   10      FALSE
139    3      FALSE
140   30       TRUE
141    2      FALSE
142   13       TRUE
143    5      FALSE
144    5      FALSE
145    5      FALSE
146    4      FALSE
147    3      FALSE
148   20       TRUE
149   12       TRUE
150   34       TRUE
151    6      FALSE
152   14       TRUE
153   16       TRUE
154    9      FALSE
155   15       TRUE
156   15       TRUE
157    0      FALSE
158    1      FALSE
159    4      FALSE
160    0      FALSE
161    0      FALSE
162    2      FALSE
163    1      FALSE
164    2      FALSE
165    0      FALSE
166    0      FALSE
167    0      FALSE
168    7      FALSE
169    2      FALSE
170    9      FALSE
171    6      FALSE
172    4      FALSE
173    1      FALSE
174    7      FALSE
175    0      FALSE
176    0      FALSE
177    4      FALSE
178    2      FALSE
179    0      FALSE
180    4      FALSE
181    2      FALSE
182   21       TRUE
183    1      FALSE
184    0      FALSE
185    1      FALSE
186   16       TRUE
187    9      FALSE
188   16       TRUE
189    0      FALSE
190   11      FALSE
191    1      FALSE
192    2      FALSE
193    3      FALSE
194    4      FALSE
195    2      FALSE
196    7      FALSE
197    7      FALSE
198    0      FALSE
199    1      FALSE
200    1      FALSE
201    0      FALSE
202   13       TRUE
203    1      FALSE
204    0      FALSE
205    1      FALSE
206    0      FALSE
207    4      FALSE
208    0      FALSE
209    4      FALSE
210    0      FALSE
211    2      FALSE
212    0      FALSE
213    4      FALSE
214    0      FALSE
215    4      FALSE
216    3      FALSE
217    1      FALSE
218    0      FALSE
219    1      FALSE
220    4      FALSE
221    1      FALSE
222    9      FALSE
223    0      FALSE
224    4      FALSE
225    8      FALSE
226   13       TRUE
227    0      FALSE
228    0      FALSE
229    0      FALSE
230    0      FALSE
231    2      FALSE
232    5      FALSE
233    1      FALSE
234    0      FALSE
235    3      FALSE
236    1      FALSE
237    2      FALSE
238    4      FALSE
239    5      FALSE
240    3      FALSE
241    1      FALSE
242    3      FALSE
243    6      FALSE
244    8      FALSE
245   21       TRUE
246    1      FALSE
247    7      FALSE
248    5      FALSE
249    1      FALSE
250    1      FALSE
251    0      FALSE
252    4      FALSE
253    0      FALSE
254   14       TRUE
255    2      FALSE
256    2      FALSE
257    2      FALSE
258    0      FALSE
259    1      FALSE
260   19       TRUE
261    2      FALSE
262   11      FALSE
263    3      FALSE
264    5      FALSE
265   16       TRUE
266    0      FALSE
267    5      FALSE
268    3      FALSE
269    2      FALSE
270    2      FALSE
271    8      FALSE
272    0      FALSE
273    3      FALSE
274    0      FALSE
275    1      FALSE
276    9      FALSE
277    1      FALSE
278    0      FALSE
279    0      FALSE
280    1      FALSE
281   12       TRUE
282    3      FALSE
283    0      FALSE
284    1      FALSE
285    8      FALSE
286    1      FALSE
287    1      FALSE
288    7      FALSE
289    6      FALSE
290    0      FALSE
291    8      FALSE
292    0      FALSE
293    1      FALSE
294    0      FALSE
295    4      FALSE
296   17       TRUE
297    9      FALSE
298    0      FALSE
299    0      FALSE
300    1      FALSE
301    3      FALSE
302    1      FALSE
303    2      FALSE
304    2      FALSE
305    2      FALSE
306    5      FALSE
307    3      FALSE
308    7      FALSE
309    1      FALSE
310    1      FALSE
311    3      FALSE
312    0      FALSE
313    0      FALSE
314    2      FALSE

alphaOutlier documentation built on May 30, 2017, 8:11 a.m.