ssm_analyze: Perform analyses using the Structural Summary Method

View source: R/ssm_analysis.R

ssm_analyzeR Documentation

Perform analyses using the Structural Summary Method

Description

Calculate SSM parameters with bootstrapped confidence intervals for a variety of different analysis types. Depending on what arguments are supplied, either mean-based or correlation-based analyses will be performed, one or more groups will be used to stratify the data, and contrasts between groups or measures will be calculated.

Usage

ssm_analyze(
  .data,
  scales,
  angles = octants(),
  measures = NULL,
  grouping = NULL,
  contrast = c("none", "test", "model"),
  boots = 2000,
  interval = 0.95,
  listwise = TRUE,
  measures_labels = NULL
)

Arguments

.data

Required. A data frame containing at least circumplex scales.

scales

Required. The variable names or column numbers for the variables in .data that contain circumplex scales to be analyzed.

angles

Optional. A numeric vector containing the angular displacement of each circumplex scale included in scales (in degrees). (default = octants()).

measures

Optional. The variable names or column numbers for one or more variables in .data to be correlated with the circumplex scales and analyzed using correlation-based SSM analyses. To analyze the circumplex scales using mean-based analyses, simply omit this argument or set it to NULL (default = NULL).

grouping

Optional. The variable name or column number for the variable in .data that indicates the group membership of each observation. To analyze all observations in a single group, simply omit this argument or set it to NULL (default = NULL).

contrast

Optional. A string indicating what type of contrast to run. Current options are "none" for no contrast, "model" to find SSM parameters for the difference scores, or "test" to find the difference between the SSM parameters. Note that only two groups or measures can be contrasted at a time (default = "none").

boots

Optional. A single positive integer indicating how many bootstrap resamples to use when estimating the confidence intervals (default = 2000).

interval

Optional. A single positive number between 0 and 1 (exclusive) that indicates what confidence level to use when estimating the confidence intervals (default = 0.95).

listwise

Optional. A logical indicating whether missing values should be handled by listwise deletion (TRUE) or pairwise deletion (FALSE). Note that pairwise deletion may result in different missing data patterns in each bootstrap resample and is slower to compute (default = TRUE).

measures_labels

Optional. A character vector providing a label for each measure provided in measures (in the same order) to appear in the results as well as tables and plots derived from the results. If omitted or set to NULL will default to using the measures variable names (default = NULL).

Value

A list containing the results and description of the analysis.

results

A tibble with the SSM parameter estimates

details

A list with the number of bootstrap resamples (boots), the confidence interval percentage level (interval), and the angular displacement of scales (angles)

call

A language object containing the function call that created this object

scores

A tibble containing the mean scale scores

type

A string indicating what type of SSM analysis was done

See Also

Other ssm functions: ssm_append(), ssm_parameters(), ssm_plot(), ssm_score(), ssm_table()

Other analysis functions: ssm_parameters(), ssm_score()

Examples

# Load example data
data("jz2017")

# Single-group mean-based SSM
ssm_analyze(jz2017, scales = PA:NO, angles = octants())

# Single-group correlation-based SSM
ssm_analyze(jz2017,
  scales = PA:NO, angles = octants(),
  measures = c(NARPD, ASPD)
)

# Multiple-group mean-based SSM
ssm_analyze(jz2017, scales = PA:NO, angles = octants(), grouping = Gender)

# Multiple-group mean-based SSM with contrast
ssm_analyze(jz2017,
  scales = PA:NO, angles = octants(), grouping = Gender,
  contrast = "model"
)

# Single-group correlation-based SSM with contrast
ssm_analyze(jz2017,
  scales = PA:NO, angles = octants(),
  measures = c(NARPD, ASPD), contrast = "test"
)

ssm_analyze(jz2017,
  scales = PA:NO, angles = octants(), measures = c(NARPD, ASPD), 
  measures_labels = c("Narcissistic", "Antisocial")
)

# Multiple-group correlation-based SSM
ssm_analyze(jz2017,
  scales = PA:NO, angles = octants(), measures = NARPD,
  grouping = Gender
)

# Multiple-group correlation-based SSM with contrast
ssm_analyze(jz2017,
  scales = PA:NO, angles = octants(), measures = NARPD,
  grouping = Gender, contrast = "test"
)



circumplex documentation built on Aug. 22, 2023, 9:11 a.m.