Produces SPSS- and SAS-like output for linear discriminant function analysis. It uses functions from the MASS package.
DFA(data, groups, variables, plot, predictive, priorprob, verbose)
A dataframe where the rows are cases & the columns are the variables.
The name of the groups variable in the dataframe, e.g., groups = 'Group'.
The names of the continuous variables in the dataframe that will be used in the DFA,
e.g., variables = c('varA', 'varB', 'varC').
Should a plot of the mean standardized discriminant function scores
for the groups be produced? The options are: TRUE (default) or FALSE.
Should a predictive DFA be conducted? The options are: TRUE (default) or FALSE.
If predictive = TRUE, how should the prior probabilities of the group sizes be computed?
The options are:
'EQUAL' for equal group sizes; or
'SIZES' (default) for the group sizes to be based on the sizes of the groups in the dataframe.
Should detailed results be displayed in console? The options are: TRUE (default) or FALSE.
If verbose = TRUE, the displayed output includes descriptive statistics for the groups, tests of univariate and multivariate normality, the results of tests of the homogeneity of the group variance-covariance matrices, eigenvalues & canonical correlations, Wilks lambda & peel-down statistics, raw and standardized discriminant function coefficients, structure coefficients, functions at group centroids, one-way ANOVA tests of group differences in scores on each discriminant function, one-way ANOVA tests of group differences in scores on each original DV, significance tests for group differences on the original DVs according to Bird et al. (2014), a plot of the group means on the standardized discriminant functions, and extensive output from predictive discriminant function analyses (if requested).
The returned output is a list with elements
canonical discriminant function coefficients
structure coefficients
standardized coefficients
standardized coefficients from SPSS
unstandardized canonical discriminant functions evaluated at the group means
group standard deviations on the unstandardized functions
standardized canonical discriminant functions evaluated at the group means
group standard deviations on the standardized functions
scores on the discriminant functions
One-way ANOVAs using the scores on a discriminant function as the DV
One-way ANOVAs on the original DVs
Significance tests when controlling the MFWER by (only) carrying out multiple t tests
Significance tests for the two-stage approach to controling the MFWER
Classifications from leave-one-out cross-validations
Cross-Tabulation of the Original and Predicted Group Memberships
Proportion of original grouped cases correctly classified
Chi-square test of independence
Press's Q significance test of classifiation accuracy for original vs. predicted group memberships
Row Frequencies
Column Frequencies
Cell Proportions
Row-Based Proportions
Column-Based Proportions
Agreement (kappas) between the Predicted and Original Group Memberships
Cross-Tabulation of the Cross-Validated and Predicted Group Memberships
Proportion of cross-validated grouped cases correctly classified
Chi-square test of indepedence
Press's Q significance test of classifiation accuracy for cross-validated vs. predicted group memberships
Row Frequencies
Column Frequencies
Cell Proportions
Row-Based Proportions
Column-Based Proportions
Agreement (kappas) between the Cross-Validated and Original Group Membership
Agreement (kappas) between the Cross-Validated and Predicted Group Memberships
Bird, K. D., & Hadzi-Pavlovic, D. (2013). Controlling the maximum familywise Type I error rate in analyses of multivariate experiments. Psychological Methods, 19(2), p. 265-280. Manly, B. F. J., & Alberto, J. A. (2017). Multivariate statistical methods: A primer (4th Edition). Chapman & Hall/CRC, Boca Raton, FL. Sherry, A. (2006). Discriminant analysis in counseling research. Counseling Psychologist, 34, 661-683. Tabachnik, B. G., & Fidell, L. S. (2013). Using multivariate statistics (6th ed.). New York, NY: Pearson. Venables, W. N. & Ripley, B. D. (2002). Modern Applied Statistics with S (4th ed.). Springer, New York.
# NOT RUN {
DFA(data = data_DFA_Field,
groups = 'Group',
variables = c('Actions','Thoughts'),
predictive = TRUE, priorprob = 'SIZES',
verbose = TRUE)
# }
# NOT RUN {
DFA(data = data_DFA_Sherry,
groups = 'Group',
variables = c('Neuroticism','Extroversion','Openness',
'Agreeableness','Conscientiousness'),
predictive = TRUE, priorprob = 'SIZES',
verbose = TRUE)
# }
Run the code above in your browser using DataLab