Learn R Programming

circumplex (version 2.0.1)

ssm_parameters: Calculate Structural Summary Method parameters for a set of scores

Description

Calculate SSM parameters (without confidence intervals) for a set of scores and generate a data frame with customizable labels for each parameter value. This function requires the input to be a numeric vector (or coercable to one) and returns only the parameters. See ssm_score() for a similar function that calculates SSM parameters for each row of a data frame.

Usage

ssm_parameters(
  scores,
  angles = octants(),
  prefix = "",
  suffix = "",
  e_label = "Elev",
  x_label = "Xval",
  y_label = "Yval",
  a_label = "Ampl",
  d_label = "Disp",
  f_label = "Fit"
)

Value

A data frame containing the SSM parameters calculated from scores. For degenerate profiles the undefined parameters are returned as NA

with a warning: a flat profile (zero variance) has undefined displacement and fit, and a profile with real variance but zero amplitude (i.e., no first-harmonic component) has undefined displacement and a fit of 0. Note that this applies only to amplitudes that are zero up to machine precision; small real amplitudes are always estimated, and their uncertainty is expressed through confidence intervals (see ssm_analyze()).

Arguments

scores

Required. A numeric vector (or single row data frame) containing one score for each of a set of circumplex scales.

angles

Required. A numeric vector containing the angular displacement of each circumplex scale included in scores (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).

prefix

Optional. A string to append to the beginning of all of the SSM parameters' variable names (default = "").

suffix

Optional. A string to append to the end of all of the SSM parameters' variable names (default = "").

e_label

Optional. A string representing the variable name of the SSM elevation parameter (default = "Elev").

x_label

Optional. A string representing the variable name of the SSM x-value parameter (default = "Xval").

y_label

Optional. A string representing the variable name of the SSM y-value parameter (default = "Yval").

a_label

Optional. A string representing the variable name of the SSM amplitude parameter (default = "Ampl").

d_label

Optional. A string representing the variable name of the SSM displacement parameter (default = "Disp").

f_label

Optional. A string representing the variable name of the SSM fit or R-squared value (default = "Fit"). This value is a bounded R-squared in [0, 1] when the closed form coincides with the least-squares fit (equally spaced or otherwise harmonic-balanced angles; see angles).

See Also

Other ssm functions: plot.circumplex_ci_accuracy(), ssm_analyze(), ssm_analyze_long(), ssm_ci_accuracy(), ssm_draws(), ssm_parameters_id(), ssm_score(), 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_id(), ssm_score(), ssm_sem(), ssm_sem_parameters(), summary.circumplex_ssm_id()

Examples

Run this code
# Manually enter octant scores
scores <- c(0.55, 0.58, 0.62, 0.76, 1.21, 1.21, 1.48, 0.90)
ssm_parameters(scores)

# Customize several of the labels
ssm_parameters(scores, x_label = "LOV", y_label = "DOM")

# Add a prefix to all labels
ssm_parameters(scores, prefix = "IIP_")

Run the code above in your browser using DataLab