Utility functions
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 |
|
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_analyse_corrs
ssm_analyse_corrs(data, scales, measures, angles=OCTANTS, group=None)
Perform SSM analysis of correlations for a set of data.
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.
TYPE:
|
angles |
A tuple containing the angular displacement of each circumplex scale
included in
TYPE:
|
group |
The name of the group to be included in the analysis. Defaults to None.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
SSMResults
|
A SSMResults object containing the results of the analysis.
TYPE:
|
Source code in circumplex/circumplex.py
332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 |
|
ssm_analyse_grouped_corrs
ssm_analyse_grouped_corrs(data, scales, measures, grouping, angles=OCTANTS, grouped_angles=None)
Perform SSM analysis of correlations for a set of grouped data.
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.
TYPE:
|
grouping |
A list of the names of the groups to be included in the analysis.
TYPE:
|
angles |
A tuple 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
293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 |
|
ssm_analyse_means
ssm_analyse_means(data, scales, grouping, angles=OCTANTS, grouped_angles=None)
Perform SSM analysis of means for a set of data.
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:
|
grouping |
A list of the names of the groups to be included in the analysis.
TYPE:
|
angles |
A tuple 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
363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 |
|
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 |
|