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

summary(object, ...)

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

print(x, ...)

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

get_item_names(x)

# S4 method for dgirtIn
get_item_names(x)

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

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

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

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

# S4 method for 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

data(toy_dgirt_in) get_item_names(toy_dgirt_in)
#> $item_data #> [1] "affirmative_action" "gaymarriage_amendment" #> #> $aggregate_data #> NULL #>
get_n(toy_dgirt_in)
#> n #> 1: 2526
get_n(toy_dgirt_in, by = "year")
#> year n #> 1: 2009 524 #> 2: 2010 2002
get_n(toy_dgirt_in, by = "source")
#> source n #> 1: CCES_2009 524 #> 2: CCES_2010 2002
get_item_n(toy_dgirt_in)
#> affirmative_action gaymarriage_amendment #> 1: 2522 1994
get_item_n(toy_dgirt_in, by = "year")
#> year affirmative_action gaymarriage_amendment #> 1: 2009 524 0 #> 2: 2010 1998 1994
data(toy_dgirt_in) get_item_names(toy_dgirt_in)
#> $item_data #> [1] "affirmative_action" "gaymarriage_amendment" #> #> $aggregate_data #> NULL #>
# respondent count data(toy_dgirt_in) get_n(toy_dgirt_in)
#> n #> 1: 2526
# respondent count by year get_n(toy_dgirt_in, by = "year")
#> year n #> 1: 2009 524 #> 2: 2010 2002
# respondent count by year and survey identifier get_n(toy_dgirt_in, by = c("year", "source"))
#> year source n #> 1: 2009 CCES_2009 524 #> 2: 2010 CCES_2010 2002
data(toy_dgirt_in) get_item_n(toy_dgirt_in)
#> affirmative_action gaymarriage_amendment #> 1: 2522 1994
get_item_n(toy_dgirt_in, by = "year")
#> year affirmative_action gaymarriage_amendment #> 1: 2009 524 0 #> 2: 2010 1998 1994