dgirtin-class: A class for data ready to model

Description Usage Arguments Value Examples

Description

shape() generates objects of class dgirtIn for modeling with dgirt() and dgmrp().

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
summary(object, ...)

## S4 method for signature 'dgirtIn'
summary(object, ...)

print(x, ...)

## S4 method for signature 'dgirtIn'
print(x, ...)

get_item_names(x)

## S4 method for signature 'dgirtIn'
get_item_names(x)

get_n(x, by = NULL, aggregate_name = NULL)

## S4 method for signature 'dgirtIn'
get_n(x, by = NULL, aggregate_name = NULL)

get_item_n(x, by = NULL, aggregate_data = FALSE)

## S4 method for signature 'dgirtIn'
get_item_n(x, by = NULL, aggregate_data = FALSE)

## S4 method for signature 'dgirtIn'
show(object)

Arguments

object

An object of class dgirtIn as returned by shape.

...

Unused.

x

An object of class dgirtIn as returned by shape.

by

The name of a grouping variable.

aggregate_name

If specified get_n will operate on the table passed to shape as aggregate_data instead of on the individual data and count nonmissingness in the given variable.

aggregate_data

If specified get_item_n will operate on the table passed to shape as aggregate_data instead of on the individual data.

Value

A list of item names.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
data(toy_dgirt_in)
get_item_names(toy_dgirt_in)
get_n(toy_dgirt_in)
get_n(toy_dgirt_in, by = "year")
get_n(toy_dgirt_in, by = "source")
get_item_n(toy_dgirt_in)
get_item_n(toy_dgirt_in, by = "year")
data(toy_dgirt_in)
get_item_names(toy_dgirt_in)
# respondent count
data(toy_dgirt_in)
get_n(toy_dgirt_in)

# respondent count by year
get_n(toy_dgirt_in, by = "year")

# respondent count by year and survey identifier
get_n(toy_dgirt_in, by = c("year", "source"))

data(toy_dgirt_in)
get_item_n(toy_dgirt_in)
get_item_n(toy_dgirt_in, by = "year")

jamesdunham/dgirt documentation built on May 18, 2019, 11:19 a.m.