Conducting Multivariate One- and Two-Sample Statistical tests using SPSS Syntax

Authors

  • Delshad Shaker Ismael Botani

DOI:

https://doi.org/10.31272/jae.i144.1233

Keywords:

Multivariate one-sample, Multivariate two-sample, SPSS syntax, Custom dialog builder

Abstract

The availability of multivariate one-sample and two-sample testing procedures is often restricted or merged with other statistical tests in many statistical applications. SPSS software, known for its user-friendly Graphical User Interface (GUI) for statistical analysis, also provides a specialised programming language called SPSS syntax. This syntax allows users to execute statistical procedures by writing commands, providing an alternative to the GUI interface. The purpose of this paper is to create new dialogs written in the SPSS syntax language using custom dialog builder for extensions. These dialogs are designed to test multivariate one- and two-sample data when ∑ is unknown by applying Hotelling’s T2 test statistic, especially in situations where the GUI lacks these particular functionalities. In the case of two-sample data, both independent and paired multivariate testing methods are employed. Examples are supplied to demonstrate the key analyses performed using Hotelling's T2 tests. The syntax written for the analyses was performed using SPSS software v.27. The adoption of the developed dialogs is recommended for researchers requiring analysis of multivariate one- and two-sample data with limited or no programming experience, with potential future incorporation of the dialogs into forthcoming SPSS versions by IBM. Extending the scope of statistical analyses supported by SPSS dialogs through future research that encourages their use and supports wider acceptance of additional statistical methods not included in standard versions of SPSS.

References

Fujikoshi, Y., Ulyanov, V. V., and Shimizu, R., (2010), Multivariate Statistics: High‐Dimensional and Large‐Sample Approximations, JOHN WILEY & SONS.

IBM Corp., (2017), "IBM SPSS Statistics 25 Command Syntax Reference," IBM Corporation. [Online].Available: https://www.ibm.com/docs/SSLVMB_25.0.0/pdf/en/IBM_SPSS_Statistics_Command_Syntax_Reference.pdf.

IBM Corp., (2020), IBM SPSS Statistics for Windows, Armonk, NY. [Online] Available: https://www.ibm.com/support/pages/node/1101369

IBM Corp., (2023), "IBM SPSS Modeler Extensions,”. [Online] Available: https://www.ibm.com/docs/en/SS3RA7_18.3.0/pdf/ModelerExtensions.pdf.

Johnson, R. A., & Wichern, D. W., (2014), Applied Multivariate Statistical Analysis, Prentice Hall, 6th ed.

Pardoe, I., (2020), Applied Regression Modeling, John Wiley & Sons, 3rd ed.

Process, (2023), "Installing the PROCESS Custom Dialog in SPSS ,". [Online] Available: https://www.processmacro.org/uploads/3/4/8/5/34858384/dialoginstall.pdf.

Raykov, T., and Marcoulides, G. A., (2008), Introduction to applied multivariate analysis, Taylor & Francis Group.

Rencher, A., and Christensen, W. F., (2012), Methods of Multivariate Analysis, John Wiley & Sons, 3rd ed.

Srivastava, M. S., (2002), Methods of multivariate Statistics, New York: Wiley-Interscience.

Appendix

TITLE Test of Multivariate One Sample.

SET PRINTBACK=off.

Compute one=1.

Matrix.

get x

/variables=%%First_group%%

/missing=accept

/sysmis=omit.

get mu

/variables=%%Mu%%

/missing=accept

/sysmis=omit.

get one

/variables=one

/missing=accept

/sysmis=omit.

compute n=nrow (x).

compute p=ncol (x).

compute xbar=transpos(one)*x/n.

compute xbar_mat=one*xbar.

compute x_xbar=x-xbar_mat.

compute var_x=(transpos(x_xbar)*x_xbar)/(n-1).

compute inv_var_x=inv(var_x).

compute hotelling_t2=n*transpos(transpos(xbar)-mu)*inv_var_x*(transpos(xbar)-mu).

compute p_value=SIG.F(((n-p)/((n-1)*p))*hotelling_t2,p,n-p).

print mu / title "Mu zero".

print n / title "Number of Rows".

print p / title "Number of columns".

print xbar / title "X bar" /format f8.3.

print var_x/ title "Variance of X Matrix" /format f8.3.

print inv_var_x/ title "Inverse of Var-Covar Matrix" /format f8.3.

print hotelling_t2/ title "Hotelling's T2".

print p_value/ title "P-Value of the T2".

End Matrix.

Delete variables one.

**********************************************************************

TITLE Test of Multivariate Independent Two Samples.

SET PRINTBACK=off.

compute one=1.

Matrix.

get T1

/variables=%%First_group%%

/missing=accept

/sysmis=omit.

get T2

/variables=%%Second_group%%

/missing=accept

/sysmis=omit.

get one

/variables=one

/missing=accept

/sysmis=omit.

COMPUTE n1=nrow(t1).

COMPUTE n2=nrow(t2).

COMPUTE p=ncol(t1).

COMPUTE T1bar=transpos(one)*t1/n1.

COMPUTE T2bar=transpos(one)*t2/n2.

COMPUTE T1_T2=T1bar-T2bar.

compute T1bar_mat=one*T1bar.

compute T2bar_mat=one*T2bar.

compute T1_T1bar=T1-T1bar_mat.

compute T2_T2bar=T2-T2bar_mat.

compute var_T1=(transpos(T1_T1bar)*T1_T1bar)/(n1-1).

compute var_T2=(transpos(T2_T2bar)*T2_T2bar)/(n2-1).

compute Sp=1/(n1+n2-2)*((n1-1)*var_T1+(n2-1)*var_T2).

compute inv_sp=inv(Sp).

compute hotelling_t2=((n1*n2)/(n1+n2))*(T1_T2*inv_sp*(transpos(T1_T2))).

compute p_value=SIG.F(((n1+n2-p-1) / ((n1+n2-2)*p))*hotelling_t2,p,n1+n2-p-1).

print n1 / title "Number of rows in sample 1".

print n2 / title "Number of rows in sample 2".

print p / title "Number of variables".

print T1bar /title"Mean vector of First Sample"/format f8.3.

print T2bar /title"Mean vector of Second Sample"/format f8.3.

print var_T1 / title "VARINCE MATRIX of First Sample"/format f8.3.

print var_T2 / title "VARINCE MATRIX of Second Sample"/format f8.3.

print Sp / title "Pooled Variance Covariance Matrix"/format f8.3.

print inv_sp/ title "Inverse of Pooled Variance Covariance Matrix"/format f8.3.

print hotelling_t2/ title "Hotelling T2 Test".

print p_value/ title "P-Value of the Hotelling T2".

End matrix.

Delete variables one.

**********************************************************************

TITLE Test of Multivariate Paired Two Samples.

SET PRINTBACK=off.

compute one=1.

Matrix.

get T1

/variables=%%First_group%%

/missing=accept

/sysmis=omit.

get T2

/variables=%%Second_group%%

/missing=accept

/sysmis=omit.

get one

/variables=one

/missing=accept

/sysmis=omit.

compute d = T1-T2.

compute n=nrow (d).

compute p=ncol (d).

compute dbar=t(one)*d/n.

compute dbar_mat=one*dbar.

compute d_dbar=d-dbar_mat.

compute var_d=(t(d_dbar)*d_dbar)/(n-1).

compute inv_var_d=inv(var_d).

compute hotelling_t2=n*dbar*inv_var_d*t(dbar).

compute p_value=SIG.F(((n-p)/((n-1)*p))*hotelling_t2,p,n-p).

print n / title "Number of Rows".

print p / title "Number of columns".

print dbar / title "d bar" /format f8.3.

print var_d/ title "Variance of d Matrix" /format f8.3.

print inv_var_d/ title "Inverse of Var-Covar Matrix d"/format f8.3.

print hotelling_t2/ title "Hotelling's T2" /format f8.3.

print p_value/ title "P-Value of the T2" /format f8.3.

End Matrix.

Delete variables one.

Downloads

Published

2024-07-25

How to Cite

Conducting Multivariate One- and Two-Sample Statistical tests using SPSS Syntax. (2024). Journal of Administration and Economics, 49(144), 1-13. https://doi.org/10.31272/jae.i144.1233

Similar Articles

1-10 of 396

You may also start an advanced similarity search for this article.