mixdata: Mixed Data

Description Usage Arguments Details See Also Examples

Description

as.mixdata checks if its argument is mixed data, if true, it returns the data with class "mixdata", if false, it returns NULL.

is.mixdata returns TRUE if its argument is of class "mixdata" and FALSE otherwise.

Usage

1
2

Arguments

x

object to be tested.

Details

Mixed data consist of grouped data and conditional data (if available). Grouped data is either a data frame or a matrix, whose first column should be right boundaries of grouping intervals where the first and last intervals are open-ended; whose second column should consist of the frequencies indicating numbers of observations falling into each interval. If conditional data are available, mixed data should have k + 2 columns, where k is the number of components, whose element in row j and column i + 2 is the number of observations from the jth interval belonging to the ith component.

See Also

mixgroup to construct mixed data.

Examples

1
2
3
4
5
6
7
8
9
data(pike65) # load data set `pike65'
pike65 # display the mixed data `pike65'
data(pike65sg) # load data set `pike65sg'
pike65sg # display the mixed data `pike65sg'
data(pikepar)
as.mixdata(pikepar)
as.mixdata(pike65)
is.mixdata(pike65)
is.mixdata(as.mixdata(pike65))

Example output

   length freq
1   19.75    4
2   21.75   10
3   23.75   21
4   25.75   11
5   27.75   14
6   29.75   31
7   31.75   39
8   33.75   70
9   35.75   71
10  37.75   44
11  39.75   42
12  41.75   36
13  43.75   23
14  45.75   22
15  47.75   17
16  49.75   12
17  51.75   12
18  53.75   11
19  55.75    8
20  57.75    3
21  59.75    6
22  61.75    6
23  63.75    3
24  65.75    2
25    Inf    5
   length freq age1 age2 age3 age4 age5
1   19.75    4    0    0    0    0    0
2   21.75   10    0    0    0    0    0
3   23.75   21    0    0    0    0    0
4   25.75   11    9    2    0    0    0
5   27.75   14    8    6    0    0    0
6   29.75   31    0    0    0    0    0
7   31.75   39    0    0    0    0    0
8   33.75   70    0    0    0    0    0
9   35.75   71    0    0    0    0    0
10  37.75   44    0    0    0    0    0
11  39.75   42    0    0    0    0    0
12  41.75   36    0    2   34    0    0
13  43.75   23    0    0   21    0    0
14  45.75   22    0    0    0    0    0
15  47.75   17    0    0    5    5    0
16  49.75   12    0    0    6    5    1
17  51.75   12    0    0    5    7    0
18  53.75   11    0    0    4    4    3
19  55.75    8    0    0    0    8    0
20  57.75    3    0    0    0    2    1
21  59.75    6    0    0    0    1    5
22  61.75    6    0    0    0    2    4
23  63.75    3    0    0    0    0    0
24  65.75    2    0    0    0    0    0
25    Inf    5    0    0    0    0    0
NULL
   length freq
1   19.75    4
2   21.75   10
3   23.75   21
4   25.75   11
5   27.75   14
6   29.75   31
7   31.75   39
8   33.75   70
9   35.75   71
10  37.75   44
11  39.75   42
12  41.75   36
13  43.75   23
14  45.75   22
15  47.75   17
16  49.75   12
17  51.75   12
18  53.75   11
19  55.75    8
20  57.75    3
21  59.75    6
22  61.75    6
23  63.75    3
24  65.75    2
25    Inf    5
[1] FALSE
[1] TRUE

mixdist documentation built on May 2, 2019, 3:34 p.m.

Related to mixdata in mixdist...