Learn R Programming

circumplex (version 2.0.1)

ssm_score: Calculate SSM parameters by row and add results as new columns

Description

Calculate the SSM parameters for each row of a data frame and add the results as additional columns. This can be useful when the SSM is being used for the description or visualization of individual data points rather than for statistical inference on groups of data points.

Usage

ssm_score(data, scales, angles = octants(), append = TRUE, ...)

Value

A data frame containing .data plus six additional columns containing the SSM parameters (calculated rowwise).

Arguments

data

Required. A data frame or matrix 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

Required. A numeric vector containing the angular displacement of each circumplex scale included in scales (in degrees). The closed-form SSM estimator used here equals the ordinary-least-squares cosine fit for equally spaced angles (e.g., octants at 45-degree intervals) -- more generally, for any angle set satisfying first- and second-harmonic balance. For angle sets violating that balance (generic unequally spaced sets), it is the conventional Gurtman estimator, not a least-squares fit, and the reported fit is then no longer a bounded R-squared in [0, 1] (it can fall below 0).

append

Optional. A logical indicating whether to append the output to data or simply return the output (default = "TRUE").

...

Optional. Additional named arguments passed to ssm_parameters(), such as prefix and suffix; each must be a single string. Unnamed or non-scalar arguments raise an error.

See Also

Other ssm functions: plot.circumplex_ci_accuracy(), ssm_analyze(), ssm_analyze_long(), ssm_ci_accuracy(), ssm_draws(), ssm_parameters(), ssm_parameters_id(), ssm_sem(), ssm_sem_parameters(), ssm_table(), summary.circumplex_ssm_id()

Other analysis functions: cpm_fit(), cpm_simulate(), ssm_analyze(), ssm_analyze_long(), ssm_ci_accuracy(), ssm_draws(), ssm_parameters(), ssm_parameters_id(), ssm_sem(), ssm_sem_parameters(), summary.circumplex_ssm_id()

Examples

Run this code
data("aw2009")
ssm_score(
  aw2009,
  scales = c("PA", "BC", "DE", "FG", "HI", "JK", "LM", "NO")
)

Run the code above in your browser using DataLab