Skip to contents

ScoringTable is a simple version of ScoreTable() or GroupedScoreTable(), that don't include the FrequencyTable internally. It can be easily saved to csv or json using export_ScoringTable() and loaded from these files using import_ScoringTable().

When using GroupedScoreTable, the columns will be named the same as the name of group. If it was created using two GroupCondition object, the names of columns will be names of the groups seperated by :

Usage

to_ScoringTable(table, ...)

# S3 method for ScoreTable
to_ScoringTable(
  table,
  scale = NULL,
  min_raw = NULL,
  max_raw = NULL,
  score_colname = "Score",
  ...
)

# S3 method for GroupedScoreTable
to_ScoringTable(table, scale = NULL, min_raw = NULL, max_raw = NULL, ...)

# S3 method for ScoringTable
summary(object, ...)

Arguments

table

ScoreTable or GroupedScoreTable object

...

further arguments passed to or from other methods.

scale

name of the scale attached in table. If only one scale is attached, it can be left as default NULL

min_raw, max_raw

absolute minimum/maximum score that can be received. If left as default NULL, the minimum/maximum available in the data will be used.

score_colname

Name of the column containing the raw scores

object

ScoringTable object

Value

ScoringTable object

Examples

Extr_ST <- 
  # create FrequencyTable
  FrequencyTable(data = IPIP_NEO_300$E) |>
  # create ScoreTable
  ScoreTable(scale = STEN) |>
  # and transform into ScoringTable
  to_ScoringTable(
    min_raw = 60,
    max_raw = 300
  )
#>  There are missing raw score values between minimum and maximum raw scores.
#>   They have been filled automatically.
#>   No. missing: 17/217 [7.83%]

summary(Extr_ST)
#> <ScoringTable>
#> No. groups: ungrouped
#> Scale: "sten"; `min`: 1; `max`: 10
#### GroupConditions creation ####

sex_grouping <- GroupConditions(
  conditions_category = "Sex",
  "Male" ~ sex == "M",
  "Female" ~ sex == "F"
)

####   Creating ScoringTable   #### 
##     based on grouped data     ##

Neu_ST <- 
  # create FrequencyTable
  GroupedFrequencyTable(
    data = IPIP_NEO_300,
    conditions = sex_grouping, 
    var = "N") |>
  # create ScoreTable
  GroupedScoreTable(
    scale = STEN) |>
  # and transform into ScoringTable
  to_ScoringTable(
    min_raw = 60,
    max_raw = 300
  )
#>  There are missing raw score values between minimum and maximum raw scores for
#>   some groups. They have been filled automatically.
#>  Male No. missing: 6/221; 2.71%
#>  Female No. missing: 12/220; 5.45%
#>  .all No. missing: 6/230; 2.61%

summary(Neu_ST)
#> <ScoringTable>
#> No. groups: 4
#> Scale: "sten"; `min`: 1; `max`: 10
#> GroupConditions: 1
#>   1. Category: Sex
#>Tested vars: "sex"
#>No. groups:: 2
#> .all groups included: TRUE