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.
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())
#> Call:
#> ssm_analyze(.data = jz2017, scales = PA:NO, angles = octants())
#>
#> Profile [All]:
#> Estimate Lower CI Upper CI
#> Elevation 0.917 0.889 0.945
#> X-Value 0.351 0.325 0.377
#> Y-Value -0.252 -0.281 -0.223
#> Amplitude 0.432 0.403 0.462
#> Displacement 324.292 320.892 327.895
#> Model Fit 0.878
#>
# Single-group correlation-based SSM
ssm_analyze(jz2017,
scales = PA:NO, angles = octants(),
measures = c(NARPD, ASPD)
)
#> Call:
#> ssm_analyze(.data = jz2017, scales = PA:NO, angles = octants(),
#> measures = c(NARPD, ASPD))
#>
#> Profile [NARPD]:
#> Estimate Lower CI Upper CI
#> Elevation 0.202 0.170 0.236
#> X-Value -0.062 -0.095 -0.028
#> Y-Value 0.179 0.146 0.212
#> Amplitude 0.189 0.157 0.222
#> Displacement 108.967 98.959 119.180
#> Model Fit 0.957
#>
#> Profile [ASPD]:
#> Estimate Lower CI Upper CI
#> Elevation 0.124 0.089 0.157
#> X-Value -0.099 -0.133 -0.064
#> Y-Value 0.203 0.169 0.238
#> Amplitude 0.226 0.191 0.263
#> Displacement 115.927 107.263 124.030
#> Model Fit 0.964
#>
# \donttest{
# Multiple-group mean-based SSM
ssm_analyze(jz2017, scales = PA:NO, angles = octants(), grouping = Gender)
#> Call:
#> ssm_analyze(.data = jz2017, scales = PA:NO, angles = octants(),
#> grouping = Gender)
#>
#> Profile [Female]:
#> Estimate Lower CI Upper CI
#> Elevation 0.946 0.908 0.984
#> X-Value 0.459 0.419 0.499
#> Y-Value -0.310 -0.354 -0.269
#> Amplitude 0.554 0.512 0.600
#> Displacement 325.963 322.056 329.930
#> Model Fit 0.889
#>
#> Profile [Male]:
#> Estimate Lower CI Upper CI
#> Elevation 0.884 0.842 0.923
#> X-Value 0.227 0.191 0.262
#> Y-Value -0.186 -0.223 -0.149
#> Amplitude 0.294 0.258 0.330
#> Displacement 320.685 313.786 327.794
#> Model Fit 0.824
#>
# Multiple-group mean-based SSM with contrast
ssm_analyze(jz2017,
scales = PA:NO, angles = octants(), grouping = Gender,
contrast = "model"
)
#> Call:
#> ssm_analyze(.data = jz2017, scales = PA:NO, angles = octants(),
#> grouping = Gender, contrast = "model")
#>
#> Contrast [Male - Female]:
#> Estimate Lower CI Upper CI
#> Elevation -0.062 -0.118 -0.002
#> X-Value -0.232 -0.281 -0.178
#> Y-Value 0.124 0.068 0.183
#> Amplitude 0.263 0.208 0.322
#> Displacement 151.858 140.042 164.184
#> Model Fit 0.855
#>
# Single-group correlation-based SSM with contrast
ssm_analyze(jz2017,
scales = PA:NO, angles = octants(),
measures = c(NARPD, ASPD), contrast = "test"
)
#> Call:
#> ssm_analyze(.data = jz2017, scales = PA:NO, angles = octants(),
#> measures = c(NARPD, ASPD), contrast = "test")
#>
#> Contrast [ASPD - NARPD]:
#> Estimate Lower CI Upper CI
#> Elevation -0.079 -0.116 -0.040
#> X-Value -0.037 -0.077 -0.001
#> Y-Value 0.024 -0.013 0.062
#> Amplitude 0.037 -0.002 0.076
#> Displacement 6.960 -2.344 17.440
#> Model Fit 0.007
#>
ssm_analyze(jz2017,
scales = PA:NO, angles = octants(), measures = c(NARPD, ASPD),
measures_labels = c("Narcissistic", "Antisocial")
)
#> Call:
#> ssm_analyze(.data = jz2017, scales = PA:NO, angles = octants(),
#> measures = c(NARPD, ASPD), measures_labels = c("Narcissistic",
#> "Antisocial"))
#>
#> Profile [Narcissistic]:
#> Estimate Lower CI Upper CI
#> Elevation 0.202 0.169 0.235
#> X-Value -0.062 -0.094 -0.029
#> Y-Value 0.179 0.144 0.212
#> Amplitude 0.189 0.155 0.224
#> Displacement 108.967 99.032 118.645
#> Model Fit 0.957
#>
#> Profile [Antisocial]:
#> Estimate Lower CI Upper CI
#> Elevation 0.124 0.087 0.158
#> X-Value -0.099 -0.134 -0.065
#> Y-Value 0.203 0.169 0.237
#> Amplitude 0.226 0.190 0.262
#> Displacement 115.927 107.512 124.482
#> Model Fit 0.964
#>
# Multiple-group correlation-based SSM
ssm_analyze(jz2017,
scales = PA:NO, angles = octants(), measures = NARPD,
grouping = Gender
)
#> Call:
#> ssm_analyze(.data = jz2017, scales = PA:NO, angles = octants(),
#> measures = NARPD, grouping = Gender)
#>
#> Profile [Female_NARPD]:
#> Estimate Lower CI Upper CI
#> Elevation 0.172 0.126 0.216
#> X-Value -0.080 -0.125 -0.035
#> Y-Value 0.202 0.150 0.250
#> Amplitude 0.217 0.165 0.269
#> Displacement 111.669 99.922 122.778
#> Model Fit 0.972
#>
#> Profile [Male_NARPD]:
#> Estimate Lower CI Upper CI
#> Elevation 0.244 0.193 0.295
#> X-Value -0.029 -0.074 0.013
#> Y-Value 0.146 0.100 0.192
#> Amplitude 0.149 0.106 0.197
#> Displacement 101.248 85.311 119.419
#> Model Fit 0.902
#>
# Multiple-group correlation-based SSM with contrast
ssm_analyze(jz2017,
scales = PA:NO, angles = octants(), measures = NARPD,
grouping = Gender, contrast = "test"
)
#> Call:
#> ssm_analyze(.data = jz2017, scales = PA:NO, angles = octants(),
#> measures = NARPD, grouping = Gender, contrast = "test")
#>
#> Contrast [NARPD: Male - Female]:
#> Estimate Lower CI Upper CI
#> Elevation 0.072 0.006 0.140
#> X-Value 0.051 -0.014 0.116
#> Y-Value -0.056 -0.125 0.008
#> Amplitude -0.068 -0.138 -0.001
#> Displacement -10.421 -30.889 10.357
#> Model Fit -0.071
#>
# }