CombScaleSpec {stenR} | R Documentation |
Combined Scale Specification
Description
Combine multiple ScaleSpec
objects into one in regards of sum_items_to_scale()
function. Useful when one scale of factor contains items of different possible
values or if there is hierarchy of scale or factors.
Also allows combining CombScaleSpec
object if the factor structure have deeper
hierarchy.
Usage
CombScaleSpec(name, ..., reverse = character(0))
## S3 method for class 'CombScaleSpec'
print(x, ...)
## S3 method for class 'CombScaleSpec'
summary(object, ...)
Arguments
name |
Name of the combined scale or factor |
... |
further arguments passed to or from other methods. |
reverse |
character vector containing names of the underlying subscales or factors that need to be reversed |
x |
a CombScaleSpec object |
object |
a CombScaleSpec object |
Value
CombScaleSpec
object
See Also
Other item preprocessing functions:
ScaleSpec()
,
sum_items_to_scale()
Examples
# ScaleSpec objects to Combine
first_scale <- ScaleSpec(
name = "First Scale",
item_names = c("Item_1", "Item_2"),
min = 1,
max = 5
)
second_scale <- ScaleSpec(
name = "Second Scale",
item_names = c("Item_3", "Item_4"),
min = 0,
max = 7,
reverse = "Item_3"
)
third_scale <- ScaleSpec(
name = "Third Scale",
item_names = c("Item_5", "Item_6"),
min = 1,
max = 5
)
# You can combine few ScaleSpec objects into CombScaleSpec
first_comb <- CombScaleSpec(
name = "First Comb",
first_scale,
second_scale,
reverse = "Second Scale"
)
print(first_comb)
# And also other CombScaleSpec objects!
second_comb <- CombScaleSpec(
name = "Second Comb",
first_comb,
third_scale
)
print(second_comb)
[Package stenR version 0.6.9 Index]