Core functions
ssm_analyse
ssm_analyse(data, scales, measures=None, grouping=None, angles=OCTANTS, grouped_angles=None)
Analyse a set of data using the SSM method.
PARAMETER | DESCRIPTION |
---|---|
data |
A dataframe containing the data to be analysed.
TYPE:
|
scales |
A list of the names of the circumplex scales to be included in the analysis.
TYPE:
|
measures |
A list of the names of the measures to be included in the analysis. Defaults to None.
TYPE:
|
grouping |
A list of the names of the groups to be included in the analysis. Defaults to None.
TYPE:
|
angles |
A tuple containing the angular displacement of each circumplex scale
included in
TYPE:
|
grouped_angles |
A dictionary containing the angular displacement of each circumplex scale
included in
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
SSMResults
|
A SSMResults object containing the results of the analysis.
TYPE:
|
Source code in circumplex/circumplex.py
254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 |
|
ssm_parameters
ssm_parameters(scores, angles, bounds=BOUNDS)
Calculate SSM parameters (without confidence intervals) for a set of scores.
PARAMETER | DESCRIPTION |
---|---|
scores |
A numeric vector (or single row dataframe) containing one score for each of a set of circumplex scales.
TYPE:
|
angles |
A numeric vector containing the angular displacement of each circumplex scale
included in
TYPE:
|
bounds |
The bounds for each of the parameters of the curve optimisation. Defaults to ([0, 0, -1], [np.inf, 360, 1]).
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
tuple
|
A tuple containing the elevation, x-value, y-value, amplitude, displacement, and R2 fit of the SSM curve.
TYPE:
|
Examples:
>>> scores = np.array([-0.5, 0, 0.25, 0.51, 0.52, 0.05, -0.26, -0.7])
>>> angles = OCTANTS
>>> results = ssm_parameters(scores, angles)
>>> [round(i, 3) for i in results]
[-0.016, -0.478, 0.333, 0.582, 145.158, 0.967]
Source code in circumplex/circumplex.py
408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 |
|
profile_plot
profile_plot(amplitude, displacement, elevation, r2, angles, scores, label, ax=None, reorder_scales=True, incl_pred=True, incl_fit=True, incl_disp=True, incl_amp=True)
Plot the SSM profile.
PARAMETER | DESCRIPTION |
---|---|
reorder_scales |
DEFAULT:
|
incl_pred |
DEFAULT:
|
incl_fit |
DEFAULT:
|
incl_disp |
DEFAULT:
|
incl_amp |
DEFAULT:
|
RETURNS | DESCRIPTION |
---|---|
Axes
|
plt.Axes: A tuple containing the figure and axis objects. |
Source code in circumplex/circumplex.py
448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 |
|