MNS {SNSchart}R Documentation

Multivariate Normal Scores

Description

Get conditional or unconditional multivariate normal score (NS) of observations (X) relative to previous observations (Y).

Usage

MNS(
  X,
  Y = NULL,
  theta = NULL,
  Ftheta = NULL,
  scoring = "Z",
  alignment = "unadjusted",
  constant = NULL,
  absolute = FALSE
)

Arguments

X

matrix or data.frame. New observations to obtain the normal scores.

Y

matrix or data.frame. If Y is not defined (no previous observation available, NULL), NS is relative to X. Default NULL.

theta

vector. Value corresponding with the Ftheta quantile.

Ftheta

vector. Quantile of the data distribution. The values that take are between (0,1).

scoring

character string. If "Z" (normal scores) (default). If "Z-SQ" (normal scores squared).

alignment

character string. Aligment of the data X and Y. Select from

  • "unadjusted": nothing is sustracte from X and Y (default).

  • "overallmean": overall mean is sustracted from X and Y.

  • "overallmedian": overall median is sustracted from X and Y.

  • "samplemean": mean from corresponding group (X and Y) is sustracted from its corresponing vector.

  • "samplemedian": median from corresponding group (X and Y) is sustracted from its corresponing vector.

  • "referencemean": mean from Y is subtracted from X and Y.

  • "referencemedian": median from Y is subtracted from X and Y.

  • "constantvalue": a constant value is subtracted from X and Y.

constant

scalar. Only used when the alignment is selected "constantvalue". Default NULL.

absolute

logical. If TRUE, the absolute aligned values are obtained. (Default FALSE)

Value

Multiple output. Select by output$

Examples

Y <- c(10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100)
Y = matrix(Y, ncol=2)
X <- c(30, 35, 45, 30, 35, 45)
X = matrix(X, ncol=2)
theta <- c(40, 40)
Ftheta <- c(0.5, 0.5)
# EXAMPLE CONDITIONAL
MNS(X = X, Y = Y, theta = theta, Ftheta = Ftheta)

[Package SNSchart version 1.4.0 Index]