RSA.ST: Surface tests

View source: R/RSA.ST.R

RSA.STR Documentation

Surface tests

Description

Calculates surface parameters a1 to a4, the stationary point, the principal axes, the eigenvectors and -values

Usage

RSA.ST(
  x = 0,
  y = 0,
  x2 = 0,
  xy = 0,
  y2 = 0,
  b0 = 0,
  SE = NULL,
  COV = NULL,
  df = NULL,
  model = "full"
)

Arguments

x

Either an RSA object (returned by the RSA function), or the coefficient for the X predictor

y

Y coefficient

x2

X^2 coefficient

xy

XY interaction coefficient

y2

Y^2 coefficient

b0

The intercept

SE

In case that the coefficients are provided directly (as parameters x, y, x2, y2, xy), SE can provide the standard errors of these estimates. SE has to be a named vector with exactly five elements with the names of the coefficients, e.g.: SE=c(x=.1, y=.2, x2=.1, y2=.5, xy=.3). SEs of all parameters have to be provided, otherwise the function will print an error. In case standard errors and the covariances (see below) and df (see below) are provided, parametric confidence intervals for a1 to a4 are calculated.

COV

Covariances between parameters. COV has to be a named vector with exactly four elements with the names of four specific covariances, e.g.: COV=c(x_y=.1, x2_y2 = .2, x2_xy = .3, y2_xy = .4), where x_y is the covariance between x and y, and so on. All these covariances have to be provided with exactly these names, otherwise the function will print an error.

df

Degrees of freedom for the calculation of a1 to a4 confidence intervals. The df are the residual dfs of the model (df = n - estimated parameters). For the full second-order polynomial model, this is 'n - 6 - number of control variables' in a regular regression (the following parameters are estimated: Intercept, x, y, x2, xy, y2, all control variables). df should be a single number.

model

If x is an RSA object, this parameter specifies the model from which to extract the coefficients

Details

No details so far.

Value

Returns surface parameters a1 to a5. If an RSA object or SE, COV and df are provided, also significance test and standard errors of a1 to a5 are reported. The stationary point (X0, Y0, and Z0). First principal axis (PA) relative to the X-Y plane (p10 = intercept, p11 = slope), second PA (p20 = intercept, p21 = slope). M = eigenvectors, l = eigenvalues, L = lambda matrix as1X to as4X: surface parameters of the PA, relative to X values as1Y to as4Y: surface parameters of the PA, relative to Y values PA1.curvX: quadratic component of the first PA, as seen from X axis PA2.curvX: quadratic component of the second PA, as seen from X axis PA1.curv: quadratic component of the first PA, after optimal coord transformation PA2.curv: quadratic component of the second PA, after optimal coord transformation

References

Shanock, L. R., Baran, B. E., Gentry, W. A., Pattison, S. C., & Heggestad, E. D. (2010). Polynomial Regression with Response Surface Analysis: A Powerful Approach for Examining Moderation and Overcoming Limitations of Difference Scores. Journal of Business and Psychology, 25, 543-554. doi:10.1007/s10869-010-9183-4 Shanock, L. R., Baran, B. E., Gentry, W. A., & Pattison, S. C. (2014). Erratum to: Polynomial regression with response surface analysis: A powerful approach for examining moderation and overcoming limitations of difference scores. Journal of Business and Psychology, 29, . http://doi.org/10.1007/s10869-013-9317-6

See Also

RSA

Examples

# get surface parameters from known parameters
# example from Shanock et al. (2010), p. 548, Table 2
RSA.ST(x=-.23, y=.77, x2=-.07, y2=-.10, xy=.27)


## Compute standard errors and p values for surface parameters 
## from external regression coefficients:
# standard errors for coefficients
SE <- c(x=.09, y=.09, x2=.07, y2=.07, xy=.11)
# covariances for specific coefficients:
COV <- c(x_y= -.000, x2_y2 = .001, x2_xy = -.003, y2_xy = -.004)
RSA.ST(x = .131, y = .382, x2 = .074, xy = .002, y2 = .039, SE=SE, COV=COV, df=181)


# Get surface parameters from a computed RSA object
set.seed(0xBEEF)
n <- 300
err <- 2
x <- rnorm(n, 0, 5)
y <- rnorm(n, 0, 5)
df <- data.frame(x, y)
df <- within(df, {
	diff <- x-y
	absdiff <- abs(x-y)
	SD <- (x-y)^2
	z.diff <- diff + rnorm(n, 0, err)
	z.abs <- absdiff + rnorm(n, 0, err)
	z.sq <- SD + rnorm(n, 0, err)
	z.add <- diff + 0.4*x + rnorm(n, 0, err)
	z.complex <- 0.4*x + - 0.2*x*y + + 0.1*x^2 - 0.03*y^2 + rnorm(n, 0, err)
})

r1 <- RSA(z.sq~x*y, df, models="full")
RSA.ST(r1)

RSA documentation built on Jan. 12, 2023, 9:07 a.m.

Related to RSA.ST in RSA...