What statistical analysis should I use? Statistical analyses using SPSS (2024)

Introduction

This page shows how to perform a number of statistical tests using SPSS. Eachsection gives a brief description of the aim of the statistical test, when it is used, anexample showing the SPSS commands and SPSS (often abbreviated) output with a brief interpretation of theoutput. You can see the page Choosing theCorrect Statistical Test for a table that shows an overview of when each test isappropriate to use. In deciding which test is appropriate to use, it is important toconsider the type of variables that you have (i.e., whether your variables are categorical,ordinal or interval and whether they are normally distributed), see What is the difference betweencategorical, ordinal and interval variables? for more information on this.

About the hsb data file

Most of the examples in this page will use a data file called hsb2, high schooland beyond. This data file contains 200 observations from a sample of high schoolstudents with demographic information about the students, such as their gender (female),socio-economic status (ses) and ethnic background (race). It also contains anumber of scores on standardized tests, including tests of reading (read), writing(write), mathematics (math) and social studies (socst).You can get the hsb data file by clicking on hsb2.

One sample t-test

A one sample t-test allows us to test whether a sample mean (of a normallydistributed interval variable) significantly differs from a hypothesizedvalue. For example, using the hsb2 data file, say we wish to testwhether the average writing score (write) differs significantly from 50. Wecan do this as shown below.

t-test/testval = 50/variable = write.

What statistical analysis should I use? Statistical analyses using SPSS (1)

What statistical analysis should I use? Statistical analyses using SPSS (2)

The mean of the variable write for this particular sample of students is 52.775,which is statistically significantly different from the test value of 50. We wouldconclude that this group of students has a significantly higher mean on the writing testthan 50.

One sample median test

A one sample median test allows us to test whether a sample median differssignificantly from a hypothesized value. We will use the same variable, write,as we did in the one sample t-test example above, but we do not needto assume that it is interval and normally distributed (we only need to assume that writeis an ordinal variable).

nptests/onesample test (write) wilcoxon(testvalue = 50).

What statistical analysis should I use? Statistical analyses using SPSS (3)

What statistical analysis should I use? Statistical analyses using SPSS (4)

Binomial test

A one sample binomial test allows us to test whether the proportion of successes on atwo-level categorical dependent variable significantly differs from a hypothesizedvalue. For example, using the hsb2 data file, say we wish to testwhether the proportion of females (female) differs significantly from 50%, i.e.,from .5. We can do this as shown below.

npar tests/binomial (.5) = female.

What statistical analysis should I use? Statistical analyses using SPSS (5)

The results indicate that there is no statistically significant difference (p =.229). In other words, the proportion of females in this sample does notsignificantly differ from the hypothesized value of 50%.

Chi-square goodness of fit

A chi-square goodness of fit test allows us to test whether the observed proportionsfor a categorical variable differ from hypothesized proportions. For example, let’ssuppose that we believe that the general population consists of 10% Hispanic, 10% Asian,10% African American and 70% White folks. We want to test whether the observedproportions from our sample differ significantly from these hypothesized proportions.

npar test/chisquare = race/expected = 10 10 10 70.

What statistical analysis should I use? Statistical analyses using SPSS (6)

What statistical analysis should I use? Statistical analyses using SPSS (7)

These results show that racial composition in our sample does not differ significantlyfrom the hypothesized values that we supplied (chi-square with three degrees of freedom =5.029, p = .170).

Two independent samples t-test

An independent samples t-test is used when you want to compare the means of a normallydistributed interval dependent variable for two independent groups. For example,using the hsb2 data file, say we wish to test whether the mean for writeis the same for males and females.

t-test groups = female(0 1)/variables = write.

What statistical analysis should I use? Statistical analyses using SPSS (8)

What statistical analysis should I use? Statistical analyses using SPSS (9)

Because the standard deviations for the two groups are similar (10.3 and8.1), we will use the “equal variances assumed” test. The results indicate that there is a statistically significant difference between themean writing score for males and females (t = -3.734, p = .000). In other words,females have a statistically significantly higher mean score on writing (54.99) than males(50.12).

See also

  • SPSS Learning Module:An overview of statistical tests in SPSS

Wilcoxon-Mann-Whitney test

The Wilcoxon-Mann-Whitney test is a non-parametric analog to the independent samplest-test and can be used when you do not assume that the dependent variable is a normallydistributed interval variable (you only assume that the variable is at least ordinal). Youwill notice that the SPSS syntax for the Wilcoxon-Mann-Whitney test is almost identicalto that of the independent samples t-test. We will use the same data file (the hsb2 data file) and the same variables in this example as we did in the independent t-test example above and will not assume that write,our dependent variable, is normally distributed.

npar test /m-w = write by female(0 1).
What statistical analysis should I use? Statistical analyses using SPSS (10)

The results suggest that there is a statistically significant differencebetween the underlying distributions of the write scores of males andthe write scores of females(z = -3.329, p = 0.001).

See also

  • FAQ: Whyis the Mann-Whitney significant when the medians are equal?

Chi-square test

A chi-square test is used when you want to see if there is a relationship between twocategorical variables. In SPSS, the chisq option is used on thestatistics subcommand of the crosstabscommand to obtain the test statistic and its associated p-value. Using the hsb2 data file, let’s see if there is a relationship between the type ofschool attended (schtyp) and students’ gender (female). Remember thatthe chi-square test assumes that the expected value for each cell is five orhigher. Thisassumption is easily met in the examples below. However, if this assumption is notmet in your data, please see the section on Fisher’s exact test below.

crosstabs /tables = schtyp by female /statistic = chisq.

What statistical analysis should I use? Statistical analyses using SPSS (11)

What statistical analysis should I use? Statistical analyses using SPSS (12)

These results indicate that there is no statistically significant relationship betweenthe type of school attended and gender (chi-square with one degree of freedom =0.047, p= 0.828).

Let’s look at another example, this time looking at the linear relationship between gender (female)and socio-economic status (ses). The point of this example is that one (orboth) variables may have more than two levels, and that the variables do not have to havethe same number of levels. In this example, female has two levels (male andfemale) and ses has three levels (low, medium and high).

crosstabs /tables = female by ses /statistic = chisq.

What statistical analysis should I use? Statistical analyses using SPSS (13)

What statistical analysis should I use? Statistical analyses using SPSS (14)

Again we find that there is no statistically significant relationship between thevariables (chi-square with two degrees of freedom = 4.577, p = 0.101).

See also

  • SPSS Learning Module: An Overview of Statistical Tests in SPSS

Fisher’s exact test

The Fisher’s exact test is used when you want to conduct a chi-square test but one ormore of your cells has an expected frequency of five or less. Remember that thechi-square test assumes that each cell has an expected frequency of five or more, but theFisher’s exact test has no such assumption and can be used regardless of how small theexpected frequency is. In SPSS unless you have the SPSS Exact Test Module, youcan only perform a Fisher’s exact test on a 2×2 table, and these results arepresented by default. Please see the results from the chi squaredexample above.

One-way ANOVA

A one-way analysis of variance (ANOVA) is used when you have a categorical independentvariable (with two or more categories) and a normally distributed interval dependentvariable and you wish to test for differences in the means of the dependent variablebroken down by the levels of the independent variable. For example, using the hsb2 data file, say we wish to test whether the mean of writediffers between the three program types (prog). The command for this testwould be:

oneway write by prog.

What statistical analysis should I use? Statistical analyses using SPSS (15)

The mean of the dependent variable differs significantly among the levels of programtype. However, we do not know if the difference is between only two of the levels orall three of the levels. (The F test for the Model is the same as the F testfor prog because prog was the only variable entered into the model. Ifother variables had also been entered, the F test for the Model would have beendifferent from prog.) To see the mean of write for each level ofprogram type,

means tables = write by prog.

What statistical analysis should I use? Statistical analyses using SPSS (16)

From this we can see that the students in the academic program have the highest meanwriting score, while students in the vocational program have the lowest.

See also

  • SPSS Textbook Examples: Design and Analysis, Chapter 7
  • SPSS TextbookExamples: Applied Regression Analysis, Chapter 8
  • SPSS FAQ: How can I do ANOVA contrasts in SPSS?
  • SPSS Library: Understanding and Interpreting Parameter Estimates in Regression and ANOVA

Kruskal Wallis test

The Kruskal Wallis test is used when you have one independent variable withtwo or morelevels and an ordinal dependent variable. In other words, it is the non-parametric versionof ANOVA and a generalized form of the Mann-Whitney test method since it permitstwo or moregroups. We will use the same data file as the one way ANOVAexample above (the hsb2 data file) and the same variables as in theexample above, but we will not assume that write is a normally distributed intervalvariable.

npar tests /k-w = write by prog (1,3).

What statistical analysis should I use? Statistical analyses using SPSS (17)

What statistical analysis should I use? Statistical analyses using SPSS (18)

If some of the scores receive tied ranks, then a correction factor is used, yielding aslightly different value of chi-squared. With or without ties, the results indicatethat there is a statistically significant difference among the three type of programs.

Paired t-test

A paired (samples) t-test is used when you have two related observations(i.e., two observations per subject) and you want to see if the means on these two normallydistributed interval variables differ from one another. For example, using the hsb2 data file we will test whether the mean of read is equal tothe mean of write.

t-test pairs = read with write (paired).

What statistical analysis should I use? Statistical analyses using SPSS (19)

What statistical analysis should I use? Statistical analyses using SPSS (20)

These results indicate that the mean of read is not statistically significantlydifferent from the mean of write (t = -0.867, p = 0.387).

Wilcoxon signed rank sum test

The Wilcoxon signed rank sum test is the non-parametric version of a paired samplest-test. You use the Wilcoxon signed rank sum test when you do not wish to assumethat the difference between the two variables is interval and normally distributed (butyou do assume the difference is ordinal). We will use the same example as above, but wewill not assume that the difference between read and write is interval andnormally distributed.

npar test /wilcoxon = write with read (paired).

What statistical analysis should I use? Statistical analyses using SPSS (21)

What statistical analysis should I use? Statistical analyses using SPSS (22)

The results suggest that there is not a statistically significant difference between readand write.

If you believe the differences between read and write were not ordinalbut could merely be classified as positive and negative, then you may want to consider asign test in lieu of sign rank test. Again, we will use the same variables in thisexample and assume that this difference is not ordinal.

npar test /sign = read with write (paired).

What statistical analysis should I use? Statistical analyses using SPSS (23)

What statistical analysis should I use? Statistical analyses using SPSS (24)

Weconclude that no statistically significant difference was found (p=.556).

McNemar test

You would perform McNemar’s testif you were interested in the marginal frequencies of two binary outcomes.These binary outcomes may be the same outcome variable on matched pairs(like a case-control study) or two outcomevariables from a single group. Continuing with the hsb2 dataset usedin several above examples, let us create two binary outcomes in our dataset: himath andhiread. These outcomes can be considered in atwo-way contingency table. The null hypothesis is that the proportionof students in the himath group is the same as the proportion ofstudents in hiread group (i.e., that the contingency table issymmetric).

compute himath = (math>60).compute hiread = (read>60).execute.crosstabs /tables=himath BY hiread /statistic=mcnemar /cells=count.

What statistical analysis should I use? Statistical analyses using SPSS (25)

What statistical analysis should I use? Statistical analyses using SPSS (26)

McNemar’s chi-square statistic suggests that there is not a statisticallysignificant difference in the proportion of students in the himath groupand the proportion of students in the hiread group.

One-way repeated measures ANOVA

You would perform a one-way repeated measures analysis of variance if you had onecategorical independent variable and a normally distributed interval dependent variablethat was repeated at least twice for each subject. This is the equivalent of thepaired samples t-test, but allows for two or more levels of the categorical variable. Thistests whether the mean of the dependent variable differs by the categoricalvariable. We have an example data set called rb4wide,which is used in Kirk’s book Experimental Design. In this data set, y is thedependent variable, a is the repeated measure and s is the variable thatindicates the subject number.

glm y1 y2 y3 y4 /wsfactor a(4).

What statistical analysis should I use? Statistical analyses using SPSS (27)

What statistical analysis should I use? Statistical analyses using SPSS (28)

What statistical analysis should I use? Statistical analyses using SPSS (29)

What statistical analysis should I use? Statistical analyses using SPSS (30)

What statistical analysis should I use? Statistical analyses using SPSS (31)

What statistical analysis should I use? Statistical analyses using SPSS (32)You will notice that this output gives four different p-values. Theoutput labeled “sphericity assumed” is the p-value (0.000) that you would get if you assumed compoundsymmetry in the variance-covariance matrix. Because that assumption is often notvalid, the three other p-values offer various corrections (the Huynh-Feldt, H-F,Greenhouse-Geisser, G-G and Lower-bound). No matter which p-value youuse, our results indicate that we have a statistically significant effect of a atthe .05 level.

See also

  • SPSS Textbook Examples from Design and Analysis: Chapter 16
  • SPSS Library: Advanced Issues in Using and Understanding SPSS MANOVA
  • SPSS Code Fragment: Repeated Measures ANOVA

Repeated measures logistic regression

If you have a binary outcomemeasured repeatedly for each subject and you wish to run a logisticregression that accounts for the effect of multiple measures from singlesubjects, you can perform a repeated measures logistic regression. InSPSS, this can be done using the GENLIN command and indicating binomialas the probability distribution and logit as the link function to be used inthe model. The exercise data file contains3 pulse measurements from each of 30 people assigned to 2 different diet regiments and3 different exercise regiments. If we define a “high” pulse as being over100, we can then predict the probability of a high pulse using dietregiment.

GET FILE='C:mydatahttps://stats.idre.ucla.edu/wp-content/uploads/2016/02/exercise.sav'.
GENLIN highpulse (REFERENCE=LAST) BY diet (order = DESCENDING)/MODEL diet DISTRIBUTION=BINOMIAL LINK=LOGIT/REPEATED SUBJECT=id CORRTYPE = EXCHANGEABLE.

What statistical analysis should I use? Statistical analyses using SPSS (33)

These results indicate that diet is not statisticallysignificant (Wald Chi-Square = 1.562, p = 0.211).

Factorial ANOVA

A factorial ANOVA has two or more categorical independent variables (either with orwithout the interactions) and a single normally distributed interval dependentvariable. For example, using the hsb2 data file we will look atwriting scores (write) as the dependent variable and gender (female) andsocio-economic status (ses) as independent variables, and we will include aninteraction of female by ses. Note that inSPSS,you do not need to have the interaction term(s) in your data set. Rather, you canhave SPSS create it/them temporarily by placing an asterisk between the variables thatwill make up the interaction term(s).

glm write by female ses.What statistical analysis should I use? Statistical analyses using SPSS (34)

These results indicate that the overall model is statistically significant (F =5.666, p= 0.00). The variables female and ses are also statisticallysignificant (F = 16.595, p = 0.000 and F = 6.611, p = 0.002, respectively). However,that interaction between female and ses is not statistically significant (F= 0.133, p = 0.875).

See also

  • SPSS Textbook Examples from Design and Analysis: Chapter 10
  • SPSS FAQ: How can I do tests of simple main effects in SPSS?
  • SPSS FAQ: How do I plotANOVA cell means in SPSS?
  • SPSS Library: An Overview of SPSS GLM

Friedman test

You perform a Friedman test when you have one within-subjects independentvariable with two or more levels and a dependent variable that is not intervaland normally distributed (but at least ordinal). We will use this testto determine if there is a difference in the reading, writing and mathscores. The null hypothesis in this test is that the distribution of theranks of each type of score (i.e., reading, writing and math) are thesame. To conduct a Friedman test, the data needto be in a long format. SPSS handles this for you, but in otherstatistical packages you will have to reshape the data before you can conductthis test.

npar tests /friedman = read write math.

What statistical analysis should I use? Statistical analyses using SPSS (35)

What statistical analysis should I use? Statistical analyses using SPSS (36)

Friedman’s chi-square has a value of 0.645 and a p-value of 0.724 and is not statisticallysignificant. Hence, there is no evidence that the distributions of thethree types of scores are different.

Ordered logistic regression

Ordered logistic regression is used when the dependent variable isordered, but not continuous. For example, using the hsb2 data file we will create an ordered variable called write3. This variable will have the values 1, 2 and 3, indicating alow, medium or high writing score. We do not generally recommendcategorizing a continuous variable in this way; we are simply creating avariable to use for this example. We will use gender (female),reading score (read) and social studies score (socst) aspredictor variables in this model. We will use a logit link and on theprint subcommand we have requested the parameter estimates, the (model)summary statistics and the test of the parallel lines assumption.

if write ge 30 and write le 48 write3 = 1.if write ge 49 and write le 57 write3 = 2.if write ge 58 and write le 70 write3 = 3.execute.plum write3 with female read socst/link = logit/print = parameter summary tparallel.

What statistical analysis should I use? Statistical analyses using SPSS (37)

What statistical analysis should I use? Statistical analyses using SPSS (38)

The results indicate that the overall model is statistically significant(p < .000), as are each of the predictor variables (p < .000). There aretwo thresholds for this model because there are three levels of the outcomevariable. We also see that the test of the proportional odds assumption isnon-significant (p = .563). One of the assumptions underlying ordinallogistic (and ordinal probit) regression is that the relationship betweeneach pair of outcome groups is the same. In other words, ordinal logisticregression assumes that the coefficients that describe the relationshipbetween, say, the lowest versus all higher categories of the responsevariable are the same as those that describe the relationship between thenext lowest category and all higher categories, etc. This is called theproportional odds assumption or the parallel regression assumption. Becausethe relationship between all pairs of groups is the same, there is only oneset of coefficients (only one model). If this was not the case, we wouldneed different models (such as a generalized ordered logit model) todescribe the relationship between each pair of outcome groups.

See also

  • SPSS Data Analysis Examples:Ordered logistic regression
  • SPSSAnnotated Output: Ordinal Logistic Regression

Factorial logistic regression

A factorial logistic regression is used when you have two or more categoricalindependent variables but a dichotomous dependent variable. For example, using the hsb2 data file we will use female as our dependent variable,because it is the only dichotomous variable in our data set; certainly not because itcommon practice to use gender as an outcome variable. We will use type of program (prog)and school type (schtyp) as our predictor variables. Because prog is acategorical variable (it has three levels), we need to create dummy codes for it.SPSS will do this for you by making dummy codes for all variables listed afterthe keyword with. SPSS will also create the interaction term;simply list the two variables that will make up the interaction separated bythe keyword by.

logistic regression female with prog schtyp prog by schtyp /contrast(prog) = indicator(1).

What statistical analysis should I use? Statistical analyses using SPSS (39)

What statistical analysis should I use? Statistical analyses using SPSS (40)

What statistical analysis should I use? Statistical analyses using SPSS (41)

What statistical analysis should I use? Statistical analyses using SPSS (42)

What statistical analysis should I use? Statistical analyses using SPSS (43)

The results indicate that the overall model is not statistically significant (LR chi2 =3.147, p = 0.677). Furthermore, none of the coefficients are statisticallysignificant either. This shows that the overall effect of progis not significant.

See also

  • Annotated output for logisticregression

Correlation

A correlation is useful when you want to see the relationship between two (or more)normally distributed interval variables.For example, using the hsb2data file we can run a correlation between two continuous variables, read and write.

correlations /variables = read write.
What statistical analysis should I use? Statistical analyses using SPSS (44)

In the second example, we will run a correlation between a dichotomous variable, female,and a continuous variable, write. Although it is assumed that the variables areinterval and normally distributed, we can include dummy variables when performingcorrelations.

correlations /variables = female write.
What statistical analysis should I use? Statistical analyses using SPSS (45)

In the first example above, we see that the correlation between read and writeis 0.597. By squaring the correlation and then multiplying by 100, you candetermine what percentage of the variability is shared. Let’s round0.597 to be0.6, which when squared would be .36, multiplied by 100 would be 36%. Hence readshares about 36% of its variability with write. In the output for the secondexample, we can see the correlation between write and female is0.256. Squaring this number yields .065536, meaning that female sharesapproximately 6.5% of its variability with write.

See also

  • Annotated output for correlation
  • SPSS Learning Module: An Overview of Statistical Tests in SPSS
  • SPSS FAQ: How can Ianalyze my data by categories?
  • Missing Data in SPSS

Simple linear regression

Simple linear regression allows us to look at the linear relationship between onenormally distributed interval predictor and one normally distributed interval outcomevariable. For example, using the hsb2 data file, say we wish tolook at the relationship between writing scores (write) and reading scores (read);in other words, predicting write from read.

regression variables = write read /dependent = write /method = enter.

What statistical analysis should I use? Statistical analyses using SPSS (46)

What statistical analysis should I use? Statistical analyses using SPSS (47)

What statistical analysis should I use? Statistical analyses using SPSS (48)

We see that the relationship between write and read is positive(.552)and based on the t-value (10.47) and p-value (0.000), we would conclude thisrelationship is statistically significant. Hence, we would say there is astatistically significant positive linear relationship between reading and writing.

See also

  • Regression WithSPSS: Chapter 1 –Simple and Multiple Regression
  • Annotated output for regression
  • SPSSTextbook Examples: Introduction to the Practice of Statistics,Chapter 10
  • SPSS Textbook Examples: Regression with Graphics, Chapter 2
  • SPSSTextbook Examples: Applied Regression Analysis, Chapter 5

Non-parametric correlation

A Spearman correlation is used when one or both of the variables are not assumed to benormally distributed and interval (but are assumed to be ordinal). The values of thevariables are converted in ranks and then correlated. In our example, we will lookfor a relationship between read and write. We will not assume thatboth of these variables are normal and interval.

nonpar corr /variables = read write /print = spearman.
What statistical analysis should I use? Statistical analyses using SPSS (49)

The results suggest that the relationship between read and write(rho = 0.617, p = 0.000) is statistically significant.

Simple logistic regression

Logistic regression assumes that the outcome variable is binary (i.e., coded as 0 and1). We have only one variable in the hsb2 data file that is coded0 and 1, and that is female. We understand that female is a sillyoutcome variable (it would make more sense to use it as a predictor variable), but we canuse female as the outcome variable to illustrate how the code for this command isstructured and how to interpret the output. The first variable listed after the logisticcommand is the outcome (or dependent) variable, and all of the rest ofthe variables are predictor (or independent) variables. In our example, female will be the outcomevariable, and read will be the predictor variable. As with OLS regression,the predictor variables must be either dichotomous or continuous; they cannot becategorical.

logistic regression female with read.

What statistical analysis should I use? Statistical analyses using SPSS (50)

What statistical analysis should I use? Statistical analyses using SPSS (51)

What statistical analysis should I use? Statistical analyses using SPSS (52)

What statistical analysis should I use? Statistical analyses using SPSS (53)

The results indicate that reading score (read) is not a statisticallysignificant predictor of gender (i.e., being female), Wald = .562, p = 0.453.Likewise, the test of the overall model is not statistically significant, LR chi-squared –0.56, p = 0.453.

See also

  • Annotated output for logisticregression
  • SPSS Library:What kind of contrasts are these?

Multiple regression

Multiple regression is very similar to simple regression, except that in multipleregression you have more than one predictor variable in the equation. For example,using the hsb2 data file we will predict writing score from gender (female),reading, math, science and social studies (socst) scores.

regression variable = write female read math science socst /dependent = write /method = enter.

What statistical analysis should I use? Statistical analyses using SPSS (54)

What statistical analysis should I use? Statistical analyses using SPSS (55)

What statistical analysis should I use? Statistical analyses using SPSS (56)

The results indicate that the overall model is statistically significant (F = 58.60, p= 0.000). Furthermore, all of the predictor variables are statistically significantexcept for read.

See also

  • Regression with SPSS: Chapter 1 – Simple and Multiple Regression
  • Annotated output for regression
  • SPSS Frequently AskedQuestions
  • SPSS TextbookExamples: Regression with Graphics, Chapter 3
  • SPSS TextbookExamples: Applied Regression Analysis

Analysis of covariance

Analysis of covariance is like ANOVA, except in addition to the categorical predictorsyou also have continuous predictors as well. For example, the oneway ANOVA example used write as the dependent variable and prog as theindependent variable. Let’s add read as a continuous variable to this model,as shown below.

glm write with read by prog.

What statistical analysis should I use? Statistical analyses using SPSS (57)The results indicate that even after adjusting for reading score (read), writingscores still significantly differ by program type (prog), F = 5.867, p =0.003.

See also

  • SPSS Textbook Examples from Design and Analysis: Chapter 14
  • SPSS Library: An Overview of SPSS GLM
  • SPSS Library: How do I handle interactions of continuous and categorical variables?

Multiple logistic regression

Multiple logistic regression is like simple logistic regression, except that there aretwo or more predictors. The predictors can be interval variables or dummy variables,but cannot be categorical variables. If you have categorical predictors, they shouldbe coded into one or more dummy variables. We have only one variable in our data set thatis coded 0 and 1, and that is female. We understand that female is asilly outcome variable (it would make more sense to use it as a predictor variable), butwe can use female as the outcome variable to illustrate how the code for thiscommand is structured and how to interpret the output. The first variable listedafter the logistic regression command is the outcome (or dependent)variable, and all of the rest of the variables are predictor (or independent)variables (listed after the keyword with). Inour example, female will be the outcome variable, and read and writewill be the predictor variables.

logistic regression female with read write.

What statistical analysis should I use? Statistical analyses using SPSS (58)

What statistical analysis should I use? Statistical analyses using SPSS (59)

What statistical analysis should I use? Statistical analyses using SPSS (60)

What statistical analysis should I use? Statistical analyses using SPSS (61)

These results show that both read and write aresignificant predictors of female.

See also

  • Annotated output for logisticregression
  • SPSS Textbook Examples: Applied Logistic Regression,Chapter 2
  • SPSS Code Fragments:Graphing Results in Logistic Regression

Discriminant analysis

Discriminant analysis is used when you have one or more normallydistributed interval independentvariables and a categorical dependent variable. It is a multivariate technique thatconsiders the latent dimensions in the independent variables for predicting groupmembership in the categorical dependent variable. For example, using the hsb2 data file, say we wish to use read, write and mathscores to predict the type of program a student belongs to (prog).

discriminate groups = prog(1, 3) /variables = read write math.

What statistical analysis should I use? Statistical analyses using SPSS (62)

What statistical analysis should I use? Statistical analyses using SPSS (63)

What statistical analysis should I use? Statistical analyses using SPSS (64)

What statistical analysis should I use? Statistical analyses using SPSS (65)

What statistical analysis should I use? Statistical analyses using SPSS (66)

Clearly, the SPSS output for this procedure is quite lengthy, and it isbeyond the scope of this page to explain all of it. However, the mainpoint is that two canonical variables are identified by the analysis, thefirst of which seems to be more related to program type than the second.

See also

One-way MANOVA

MANOVA (multivariate analysis of variance) is like ANOVA, except that there are two ormore dependent variables. In a one-way MANOVA, there is one categorical independentvariable and two or more dependent variables. For example, using the hsb2data file, say we wish to examine the differences in read, write and mathbroken down by program type (prog).

glm read write math by prog.

What statistical analysis should I use? Statistical analyses using SPSS (67)

What statistical analysis should I use? Statistical analyses using SPSS (68)

The students in the differentprograms differ in their joint distribution of read, write and math.

See also

  • SPSS Library: Advanced Issues in Using and Understanding SPSS MANOVA
  • GLM: MANOVA and MANCOVA
  • SPSS Library: MANOVA and GLM

Multivariate multiple regression

Multivariate multiple regression is used when you have two or moredependent variables that areto be predicted from two or more independent variables. In our example using the hsb2 data file, we willpredict write and read from female, math, science andsocial studies (socst) scores.

glm write read with female math science socst.

What statistical analysis should I use? Statistical analyses using SPSS (69)

What statistical analysis should I use? Statistical analyses using SPSS (70)

These resultsshow that all of the variables in the model have a statistically significant relationship with the joint distribution of writeand read.

Canonical correlation

Canonical correlation is a multivariate technique used to examine the relationshipbetween two groups of variables. For each set of variables, it creates latentvariables and looks at the relationships among the latent variables. It assumes that allvariables in the model are interval and normally distributed. SPSS requires thateach of the two groups of variables be separated by the keyword with. There need not be anequal number of variables in the two groups (before and after the with).

manova read write with math science /discrim.* * * * * * A n a l y s i s o f V a r i a n c e -- design 1 * * * * * * EFFECT .. WITHIN CELLS Regression Multivariate Tests of Significance (S = 2, M = -1/2, N = 97 ) Test Name Value Approx. F Hypoth. DF Error DF Sig. of F Pillais .59783 41.99694 4.00 394.00 .000 Hotellings 1.48369 72.32964 4.00 390.00 .000 Wilks .40249 56.47060 4.00 392.00 .000 Roys .59728 Note.. F statistic for WILKS' Lambda is exact. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - EFFECT .. WITHIN CELLS Regression (Cont.) Univariate F-tests with (2,197) D. F. Variable Sq. Mul. R Adj. R-sq. Hypoth. MS Error MS F READ .51356 .50862 5371.66966 51.65523 103.99081 WRITE .43565 .42992 3894.42594 51.21839 76.03569 Variable Sig. of F READ .000 WRITE .000 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Raw canonical coefficients for DEPENDENT variables Function No. Variable 1 READ .063 WRITE .049 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Standardized canonical coefficients for DEPENDENT variables Function No. Variable 1 READ .649 WRITE .467* * * * * * A n a l y s i s o f V a r i a n c e -- design 1 * * * * * * Correlations between DEPENDENT and canonical variables Function No. Variable 1 READ .927 WRITE .854 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Variance in dependent variables explained by canonical variables CAN. VAR. Pct Var DE Cum Pct DE Pct Var CO Cum Pct CO 1 79.441 79.441 47.449 47.449 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Raw canonical coefficients for COVARIATES Function No. COVARIATE 1 MATH .067 SCIENCE .048 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Standardized canonical coefficients for COVARIATES CAN. VAR. COVARIATE 1 MATH .628 SCIENCE .478 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Correlations between COVARIATES and canonical variables CAN. VAR. Covariate 1 MATH .929 SCIENCE .873* * * * * * A n a l y s i s o f V a r i a n c e -- design 1 * * * * * * Variance in covariates explained by canonical variables CAN. VAR. Pct Var DE Cum Pct DE Pct Var CO Cum Pct CO 1 48.544 48.544 81.275 81.275 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Regression analysis for WITHIN CELLS error term --- Individual Univariate .9500 confidence intervals Dependent variable .. READ reading score COVARIATE B Beta Std. Err. t-Value Sig. of t MATH .48129 .43977 .070 6.868 .000 SCIENCE .36532 .35278 .066 5.509 .000 COVARIATE Lower -95% CL- Upper MATH .343 .619 SCIENCE .235 .496 Dependent variable .. WRITE writing score COVARIATE B Beta Std. Err. t-Value Sig. of t MATH .43290 .42787 .070 6.203 .000 SCIENCE .28775 .30057 .066 4.358 .000 COVARIATE Lower -95% CL- Upper MATH .295 .571 SCIENCE .158 .418 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -* * * * * * A n a l y s i s o f V a r i a n c e -- design 1 * * * * * * EFFECT .. CONSTANT Multivariate Tests of Significance (S = 1, M = 0, N = 97 ) Test Name Value Exact F Hypoth. DF Error DF Sig. of F Pillais .11544 12.78959 2.00 196.00 .000 Hotellings .13051 12.78959 2.00 196.00 .000 Wilks .88456 12.78959 2.00 196.00 .000 Roys .11544 Note.. F statistics are exact. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - EFFECT .. CONSTANT (Cont.) Univariate F-tests with (1,197) D. F. Variable Hypoth. SS Error SS Hypoth. MS Error MS F Sig. of F READ 336.96220 10176.0807 336.96220 51.65523 6.52329 .011 WRITE 1209.88188 10090.0231 1209.88188 51.21839 23.62202 .000 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - EFFECT .. CONSTANT (Cont.) Raw discriminant function coefficients Function No. Variable 1 READ .041 WRITE .124 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Standardized discriminant function coefficients Function No. Variable 1 READ .293 WRITE .889 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Estimates of effects for canonical variables Canonical Variable Parameter 1 1 2.196* * * * * * A n a l y s i s o f V a r i a n c e -- design 1 * * * * * * EFFECT .. CONSTANT (Cont.) Correlations between DEPENDENT and canonical variables Canonical Variable Variable 1 READ .504 WRITE .959 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

The output above shows the linear combinations corresponding to the first canonicalcorrelation. At the bottom of the output are the two canonical correlations.These results indicate that the first canonical correlation is .7728. The F-test in this output tests the hypothesis that the first canonical correlation isequal to zero. Clearly, F = 56.4706 is statistically significant. However, thesecond canonical correlation of .0235 is not statistically significantly different fromzero (F = 0.1087, p = 0.7420).

Factor analysis

Factor analysis is a form of exploratory multivariate analysis that is used to eitherreduce the number of variables in a model or to detect relationships amongvariables. All variables involved in the factor analysis need to beinterval andare assumed to be normally distributed. The goal of the analysis is to try toidentify factors which underlie the variables. There may be fewer factors thanvariables, but there may not be more factors than variables. For our example using the hsb2 data file, let’ssuppose that we think that there are some common factors underlying the various testscores. We will include subcommands for varimax rotation and a plot ofthe eigenvalues. We will use a principal components extraction and willretain two factors. (Using these options will make our results compatible withthose from SAS and Stata and are not necessarily the options that you willwant to use.)

factor /variables read write math science socst /criteria factors(2) /extraction pc /rotation varimax /plot eigen.

What statistical analysis should I use? Statistical analyses using SPSS (71)

What statistical analysis should I use? Statistical analyses using SPSS (72)

What statistical analysis should I use? Statistical analyses using SPSS (73)

What statistical analysis should I use? Statistical analyses using SPSS (74)

What statistical analysis should I use? Statistical analyses using SPSS (75)

What statistical analysis should I use? Statistical analyses using SPSS (76)

Communality (which is the oppositeof uniqueness) is the proportion of variance of the variable (i.e., read) that is accounted for by all of the factors taken together, and a verylow communality canindicate that a variable may not belong with any of the factors. Thescree plot may be useful in determining how many factors to retain. From the component matrix table, wecan see that all five of the test scores load onto the first factor, while all five tendto load not so heavily on the second factor. The purpose of rotating the factors is to get the variables to load either very high orvery low on each factor. In this example, because all of the variables loaded ontofactor 1 and not on factor 2, the rotation did not aid in the interpretation.Instead, it made the results even more difficult to interpret.

See also

  • SPSS FAQ: What does Cronbach’s alpha mean?
What statistical analysis should I use? Statistical analyses using SPSS (2024)

References

Top Articles
Latest Posts
Article information

Author: Dong Thiel

Last Updated:

Views: 5488

Rating: 4.9 / 5 (59 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Dong Thiel

Birthday: 2001-07-14

Address: 2865 Kasha Unions, West Corrinne, AK 05708-1071

Phone: +3512198379449

Job: Design Planner

Hobby: Graffiti, Foreign language learning, Gambling, Metalworking, Rowing, Sculling, Sewing

Introduction: My name is Dong Thiel, I am a brainy, happy, tasty, lively, splendid, talented, cooperative person who loves writing and wants to share my knowledge and understanding with you.