I.1 Cusp in SPSS

The SPSS syntax (also available on Github):

GRAPH
  /HISTOGRAM=dZY .

*Linear regression.

REGRESSION
  /MISSING LISTWISE
  /STATISTICS COEFF OUTS R ANOVA
  /CRITERIA=PIN(.05) POUT(.10)
  /NOORIGIN
  /DEPENDENT dZY
  /METHOD=ENTER Alpha.

*Flags 1.

SORT CASES BY Beta .
SPLIT FILE
  SEPARATE BY Beta .

GRAPH
  /HISTOGRAM=dZY .

SPLIT FILE
  OFF.

*Flags 2.

GRAPH
  /SCATTERPLOT(BIVAR)=dZY WITH Alpha
  /MISSING=LISTWISE .

*Cusp with nonlinear regression.

MODEL PROGRAM Intercept=0.01 B1=0.01 B2=0.01 B3=0.01 B4=0.01 .
COMPUTE PRED_ = Intercept + B1 * Beta * ZY1 + B2 * Alpha + B3 * ZY1 ** 2 + B4 * ZY1 ** 3.
NLR dZY
  /PRED PRED_
  /CRITERIA SSCONVERGENCE 1E-8 PCON 1E-8 .

*Cusp with linear regression.

COMPUTE BetaZY1 = Beta*ZY1 .
COMPUTE ZY1_2 = ZY1 ** 2 .
COMPUTE ZY1_3 = ZY1 ** 3 .
EXECUTE .

REGRESSION
  /MISSING LISTWISE
  /STATISTICS COEFF OUTS R ANOVA
  /CRITERIA=PIN(.05) POUT(.10)
  /NOORIGIN
  /DEPENDENT dZY
  /METHOD=ENTER Alpha BetaZY1 ZY1_2 ZY1_3  .

*3-D scatter.

IGRAPH /VIEWNAME='Scatterplot' /X1 = VAR(Beta) TYPE = SCALE /Y = VAR(dZY) TYPE = SCALE /X2 = VAR(Alpha) TYPE = SCALE
 /COORDINATE = THREE  /FITLINE METHOD = LLR NORMAL BANDWIDTH = FAST X1MULTIPLIER = 1.00  X2MULTIPLIER = 1.00 LINE = TOTAL
  SPIKE=OFF /X1LENGTH=3.0 /YLENGTH=3.0 /X2LENGTH=3.0 /CHARTLOOK='D:\Program Files\SPSS\Looks\dots.clo' /SCATTER COINCIDENT =
  NONE.
EXE.