CORRELATION Partial Correlation • To perform Partial Correlation Analysis, we can use the “employeedata.sav ” file. From the file we can estimate the correlation between current salary (salary) and beginning salary (salbegin), while choosing the control variable as months since hire (jobtime) and previous experience (prevexp). The order of the partial correlation coefficient is determined based on the number of control variables.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
• To discuss the procedure for conducting LogisticRegression, we would use the sample file
“employeedata.sav”. The analysis uses as a
dependent the attitude variable minority, which is coded0=no, 1=yes. The independent variables are years of education (educ), months of experience (prevexp),
jobcategory (jobcat) ( 1=clerical, 2= custodial, 3=managerial), and gender (m,f)
• Logistic regression is useful for situations inwhich you want to be able to predict thepresence or absence of a characteristic or outcome based on values of a set of predictor
variables. It is similar to a linear regressionmodel but is suited to models where thedependent variable is dichotomous. Logisticregression coefficients can be used to estimateodds ratios for each of the independent
variables in the model. Logistic regression isapplicable to a broader range of researchsituations than discriminant analysis.
• Statistics. For each analysis: total cases, selected cases,valid cases. For each categorical variable: parameter coding. For each step: variable(s) entered or removed,iteration history, -2 log-likelihood, goodness of fit,Hosmer-Lemeshow goodness-of-fit statistic, model chi-
square, improvement chi-square, classification table,correlations between variables, observed groups andpredicted probabilities chart, residual chi-square. For each variable in the equation: coefficient (B), standarderror of B, Wald statistic, R, estimated odds ratio
(exp(B)), confidence interval for exp(B), log-likelihood if term removed from model. For each variable not in theequation: score statistic, R. For each case: observedgroup, predicted probability, predicted group, residual,standardized residual.
• Data. The dependent variable should be dichotomous. Independent variables can beinterval level or categorical; if categorical, they should be dummy or indicator coded(there is an option in the procedure to recode categorical variables automatically).
• Assumptions. Logistic regression does not rely on distributional assumptions in thesame sense that discriminant analysis does. However, your solution may be morestable if your predictors have a multivariate normal distribution. Additionally, as withother forms of regression, multicollinearity among the predictors can lead to biased
estimates and inflated standard errors. The procedure is most effective when groupmembership is a truly categorical variable; if group membership is based on values of a continuous variable (for example, "high IQ" versus "low IQ"), you should consider using linear regression to take advantage of the richer information offered by thecontinuous variable itself.
• Related procedures. Use the Scatterplot procedure to screen your data for multicollinearity. If assumptions of multivariate normality and equal variance-
covariance matrices are met, you may be able to get a quicker solution using theDiscriminant Analysis procedure. If all of your predictor variables are categorical, youcan also use the Loglinear procedure. If your dependent variable is continuous, usethe Linear Regression procedure. You can use the ROC Curve procedure to plotprobabilities saved with the Logistic Regression procedure.
• Select one dichotomous dependent variable. This variable may be numeric or shortstring.
• Select one or more covariates. To include interaction terms, select all of thevariables involved in the interaction and then select >a*b>.
• To enter variables in groups (blocks), select the covariates for a block, and click Nextto specify a new block. Repeat until all blocks have been specified.• Optionally, you can select cases for analysis. Click Select, choose a selection
• The Chi-Square Test procedure tabulates avariable into categories and tests the hypothesisthat the observed frequencies do not differ fromtheir expected values.
• Chi-Square Test allows you to:
• Include all categories of the test variable, or limitthe test to a specific range.
• Use standard or customized expected values.• Obtain descriptive statistics and/or quartiles on
• A large hospital schedules discharge supportstaff assuming that patients leave the hospital ata fairly constant rate throughout the week.
However, because of increasing complaints of staff shortages, the hospital administration wantsto determine whether the number of dischargesvaries by the day of the week.
• This example uses the file dischargedata.sav .Use Chi-Square Test to test the assumption thatpatients leave the hospital at a constant rate.
• By default, the Chi-Square Test procedure buildsfrequencies and calculates an expected valuebased on all valid values of the test variable.However, you might want to restrict the range of the test to a contiguous subset of the availablevalues. As the next example shows, theprocedure easily allows for this.
• The hospital requests a follow-up analysis: Canstaff be scheduled assuming that patientsdischarged on weekdays only (Monday throughFriday) leave at a constant daily rate?
• Using the Chi-Square Test procedure, you foundthat the rate at which patients are dischargedfrom the hospital is not constant over the courseof an average week. This is largely due togreater numbers of discharges on Friday andvastly fewer numbers of discharges on Sunday.When you restricted the range of the test toweekdays, the discharge rates appeared to be
more uniform. You may be able to correct staff shortages by adopting separate weekday andweekend staff schedules.
• The Chi-Square Test procedure is useful when you wantto compare a single sample from a polychotomousvariable to an expected set of values. The proceduretabulates this variable into a set of frequencies and tests
this observed set against either a common expectedvalue or a customized set of expected values. The entirerange of the test variable is used by default; however, itsrange may be restricted to any set of contiguous values.
Additionally, descriptive statistics and/or quartiles can be
requested.• If your variable has only two outcomes, you can
• The Binomial Test procedure compares an observedproportion of cases to the proportion expected under abinomial distribution with a specified probabilityparameter. The observed proportion is defined either by
the number of cases having the first value of adichotomous variable or by the number of cases at or below a given cut point on a scale variable. By default,the probability parameter for both groups is 0.5, althoughthis may be changed. To change the probability, you
enter a test proportion for the first group. The probabilityfor the second group is equal to 1 minus the probabilityfor the first group. Additionally, descriptive statisticsand/or quartiles for the test variable may be displayed.
• For example, the percentage of churn for customers subscribing only to basicservice was 31%
• Similarly, customers who prefer morehigh-end electronic services churned at arate of about 27% within the last month.Similarly, customers who prefer morehigh-end electronic services churned at arate of about 27% within the last month.
• The asymptotic significance value is 0.07, whichis above the conventional cutoff for statisticalsignificance (0.05). By that standard, you cannotreject the null hypothesis that the churn rate for
basic service customers is equal to the churnrate in the sample at large.
• The same cannot be said for Plus servicecustomers, however. In this case, the proportion,0.16, is significantly lower than the testproportion. Many fewer Plus service customersfound another service provider last month.
• In these data, just about half of those who didnot churn fall at or below median income. As wewould expect, the difference in proportions is notsignificant.
• However, of those 274 customers who churnedlast month, the proportion with householdincomes at or below the median is significantlydifferent from the null hypothesis value. Thosewho churn tend to be the less affluentcustomers.
• The Binomial Test procedure is useful when youwant to compare a single sample from adichotomous variable to an expected proportion.If the dichotomy does not exist in the data as a
variable, one can be dynamically created basedupon a cut point on a scale variable.
• If your variable has more than two outcomes, trythe Chi-Square Test procedure.
• If you want to compare two dichotomousvariables, try the McNemar test in the Two-Related-Samples Tests procedure.
• The scale for Web Site Rating theoreticallyranges from 0 to 20, where 0 = highly unusableand 20 = highly usable. The actual range of scores is narrower, dispersing from a low of 6 to
a high of 14.• Those on the team who believe that the rating
scale is ordinal have argued to use the mode, or most frequently occurring score, as the cut point.
However, the bar chart shows that thedistribution of ratings is bimodal, with one modeat 8 and the second at 12.
• The statistics table will help you understandmore about the distribution of ratings in thesedata. While the default table is very wide, youcan easily pivot it to column format.
• ► Double-click the table to activate it. From theViewer menus choose:• Pivot
Transpose Rows and Columns
• 32 beta testers completed the task andsubmitted ratings.
• At 9.94, the average rating is almost exactly atthe center of the scale.
• The standard deviation is most useful as anindex of variability in normal distributions.However, the runs test does not make anyassumptions about normality, and we know fromthe bar chart that the distribution of ratings is notnormal.
• As we observed in the bar chart, the actualratings ranged from a low of 6 to a high of 14.
• In this second test table, the cut point is themode. Remember that the distribution of ratingsis actually bimodal
• A footnote warns you that the mode being usedis the larger of the two data values.
• The number of cases above and below this cutpoint stands in contrast to the previous table.Ratings below 12 outnumber those at or above12 by more than a 2 to 1 margin. This is notsurprising, given that 12 is also the 75thpercentile
• These test tables demonstrate that the results of theruns test may depend on your choice of cut point. In thisexample, the order of the ratings with respect to themedian is not random. On the other hand, the sameratings do not show any order with respect to either modal value. Using the runs test, you discovered thatwhether the test finds that ratings are related to timespent browsing depends on the cut point.
• Given that the test variable is composed of integer
ratings data from 0 to 20, it's probably safe to treat thesite ratings as ordinal. Thus, the results of the two"mode" tests stand, and you can proceed as though theusability scores are independent of time spent browsing.
• You should use the Runs Test procedure when you want to test thehypothesis that the values of a variable are ordered randomly withrespect to a cut point of your choosing. The default cut point is themedian; however, you can also select the mean, the mode, or evena custom value. Optionally, you can request descriptive statisticsand/or quartiles of the test variable.
• The Runs Test is often used as a precursor to running tests thatcompare the means of two or more groups, including:• The Independent-Samples T Test procedure.• The One-Way ANOVA procedure.• The Two-Independent-Samples Tests procedure.• The Tests for Several Independent Samples procedure.
• The One-Sample Kolmogorov-Smirnovprocedure is used to test the null hypothesis thata sample comes from a particular distribution. Itdoes this by finding the largest difference (in
absolute value) between two cumulativedistribution functions (CDFs)--one computeddirectly from the data; the other, frommathematical theory. Four theoreticaldistribution functions are available-- normal,
uniform, Poisson, and exponential. Optionally,descriptive statistics and/or quartiles of the testvariable can be displayed.
• The Z test statistic is the product of the squareroot of the sample size and the largest absolutedifference between the empirical and theoretical
CDFs.• Unlike much statistical testing, a significantresult here is bad news. The probability of the Zstatistic is below 0.05, meaning that the Poisson
distribution with a parameter of 1.72 is not agood fit for the number of accidents within thepast five years in this sample of drivers.
• Generally, a significant Kolmogorov-Smirnov test means one of twothings--either the theoretical distribution is not appropriate, or anincorrect parameter was used to generate that distribution. Lookingat the previous results, it is hard for the analyst to believe that thePoisson distribution is not the appropriate one to use for modelingautomobile accidents. Poisson is often used to model rare events
and, fortunately, automobile accidents are relatively rare.• The analyst wonders if gender may be confounding the test. Thetotal sample average assumes that males and females have equalnumbers of accidents, but this is probably not true. She will split thesample by gender, using each gender's average as the Poissonparameter in separate tests.
• Using the One-Sample Kolmogorov-SmirnovTest procedure, you found that, overall, thenumber of automobile accidents per driver donot follow a Poisson distribution. However, once
you split the file on gender, the distributions of accidents for males and females can individuallybe considered Poisson.
• These results demonstrate that the one-sample
Kolmogorov-Smirnov test requires not only thatyou choose the appropriate distribution but theappropriate parameter (s) for it as well.
• You can use the one-sample Kolmogorov-Smirnovprocedure to test the null hypothesis that a samplecomes from a particular distribution. Four theoreticaldistribution functions are available--normal, uniform,Poisson, and exponential. Optionally, you can requestdescriptive statistics and/or quartiles of the test variable.
• If you want to compare the distributions of two variables,use the two-sample Kolmogorov-Smirnov test in theTwo-Independent-Samples Tests procedure.
• If your variable is scale, more statistics and tests of normality are available through the Explore procedure.
• When you want to test for differences between two groups, the independent-samplest test comes naturally to mind. However, despite its simplicity, power, and robustness,the independent-samples t test is invalid when certain critical assumptions are notmet. These assumptions center around the parameters of the test variable (in thiscase, the mean and variance) and the distribution of the variable itself.
• Most important, the t test assumes that the sample mean is a valid measure of center. While the mean is valid when the distance between all scale values is equal,it's a problem when your test variable is ordinal because in ordinal scales the
distances between the values are arbitrary. Furthermore, because the variance iscalculated using squared distances from the mean, it too is invalid if those distancesare arbitrary. Finally, even if the mean is a valid measure of center, the distribution of the test variable may be so non-normal that it makes you suspicious of any test thatassumes normality.
• If any of these circumstances is true for your analysis, you should consider using thenonparametric procedures designed to test for the significance of the differencebetween two groups. They are called nonparametric because they make no
assumptions about the parameters of a distribution, nor do they assume that anyparticular distribution is being used. Two popular nonparametric tests of location (or central tendency)--the Mann-Whitney and Wilcoxon tests--and a test of location andshape--the two-sample Kolmogorov-Smirnov test--are illustrated.
• Mann-Whitney and Wilcoxon tests. You can use the Mann-Whitneyand Wilcoxon statistics to test the null hypothesis that twoindependent samples come from the same population. Their advantage over the independent-samples t test is that Mann-Whitney and Wilcoxon do not assume normality and can be used totest ordinal variables.
• Two-sample Kolmogorov-Smirnov test. Alternatively, you can usethe two-sample Kolmogorov-Smirnov test to test the null hypothesisthat two samples have the same distribution. The test variable isassumed to be continuous; however, its cumulative distributionfunction (CDF) can assume any shape at all.
• In addition to their standard output, the Mann-Whitney and Wilcoxonand the two-sample Kolmogorov-Smirnov tests display descriptivestatistics and/or quartiles of the test variable.
Using the Mann Whitney Test toTest Ordinal Outcomes
• Physicians randomly assigned female strokepatients to receive only physical therapy or physical therapy combined with emotionaltherapy. Three months after the treatments, theMann-Whitney test is used to compare eachgroup's ability to perform common activities of daily life.
• The results are collected in the file adl.sav . Usethe Mann-Whitney test to determine whether thetwo groups' abilities differ.
• The first test variable, Travel ADL, measures theability to regularly get around the community. Itranges from 0 to 4, where 0 = Same as beforeillness and 4 = Bedridden. All 46 women in the
control group and all 54 women in the treatmentgroup provided valid data for this variable.
• First, each case is ranked without regard togroup membership. Cases tied on a particular
value receive the average rank for that value. After ranking the cases, the ranks are summedwithin groups.
• Average ranks adjust for differences in thenumber of patients in both groups. If the groupsare only randomly different, the average ranksshould be about equal. For Travel ADL, theaverage ranks are over 9 points apart.
• The test variables Cooking ADL andHousekeeping ADL contain missing data. For
these variables, the value 4 = Never did any;thus, these scales do not apply to all patients.
• The U statistic is simple (but tedious) tocalculate. For each case in group 1, the number of cases in group 2 with higher ranks is counted.Tied ranks count as 1/2. This process isrepeated for group 2. The Mann-Whitney Ustatistic displayed in the table is the smaller of these two values
• The Wilcoxon W statistic is simply the smaller of the two rank sums displayed for each group in
the rank table. The values displayed here arethe rank sums for the treatment group.•
• A nice feature of the Mann-Whitney andWilcoxon tests is that the Z statistic and normaldistribution provide an excellent approximationas the sample size grows beyond 10 in either
group. The negative Z statistics indicate that therank sums are lower than their expected values.Each two-tailed significance value estimates theprobability of obtaining a Z statistic as or more
extreme (in absolute value) as the onedisplayed, if there truly is no effect of thetreatment.
• A grain processor has two corn crops withaflatoxin levels below 20 parts per billion and aresafe for human consumption. However, becauseaflatoxin varies widely across yields, he wants tocompare the levels of aflatoxin in each of theyields.
• This example uses the file aflatoxin20.sav . Use
the two-sample Kolmogorov-Smirnov test todetermine whether the distribution of aflatoxindiffers significantly between the two safe yields.
• The first three rows of the test table fall under the general category Most Extreme Differences.The differences referred to are the largestpositive and negative points of divergence
between the CDFs of the two sampledistributions.
• The first difference value, labeled Absolute, isthe absolute value of the larger of the two
difference values printed directly below it. Thisvalue will be required to calculate the teststatistic
• The Positive difference is the point at which the CDF for yield 8 exceeds the CDF for yield 4 by the greatestamount. It is 0 in this case, meaning that the distributionof aflatoxin in yield 8 never exceeds that of yield 4.
• At the opposite end of the continuum, the Negativedifference is the point at which the CDF for yield 4exceeds the CDF for yield 8 by the greatest amount.
• The Z test statistic is a function of the combined samplesize and the largest absolute difference between the two
• You should use the Mann-Whitney test when you want to test for differences betweentwo groups but you are testing an ordinal variable or you have a scale variable that insome other ways does not conform to the assumptions of the independent-samples ttest. The Mann-Whitney and Wilcoxon tests assume that the variable you are testingis at least ordinal and that its distribution is similar in both groups. You can use thetwo-sample Kolmogorov-Smirnov test to validate the assumption of similar distributions.
• The two-sample Kolmogorov-Smirnov test tests the null hypothesis that two samples
have the same distribution. It's a very flexible test because no specific shape isassumed for the underlying distribution. However, because the test makes noassumptions, it is sensitive to differences in both location and scale. You may want tocenter the test variable if you are not interested in location differences; additionally,you may want to standardize the test variable to remove both location and scale.
• You can alternatively use the Crosstabs procedure to test for differences betweentwo or more groups of an ordinal or nominal variable.
• If your test variable passes the stricter conditions of the two-sample t test, you can
use the Independent-Samples T Test procedure.• If your grouping variable has more than two groups, try the Tests for Several
Independent Samples Tests procedure.• If the samples defined by your grouping variable are not independent, try the Two-
• Although one-way analysis of variance (ANOVA) is the method of choice when testing for differences between multiple groups, itassumes that the mean is a valid estimate of center and that thedistribution of the test variable is reasonably normal and similar in allgroups. However, when your test variable is ordinal, the mean is nota valid estimate because the distances between the values arearbitrary. Even if the mean is valid, the distribution of the test
variable may be so non-normal that it makes you suspicious of anytest that assumes normality.
• When the assumptions behind the standard ANOVA are invalid or suspect, you should consider using the nonparametric proceduresdesigned to test for the significance of the difference betweenmultiple groups. They are called nonparametric because they make
no assumptions about the parameters (such as the mean andvariance) of a distribution, nor do they assume that any particular distribution is being used. In this chapter, we discuss twononparametric tests for multiple independent samples, the Kruskal-Wallis and median tests.
• The median method tests the null hypothesis that two or more independent samples have the same median. Itassumes nothing about the distribution of the testvariable, making it a good choice when you suspect thatthe distribution varies by group.
• The Kruskal-Wallis test is a one-way analysis of varianceby ranks. It tests the null hypothesis that multipleindependent samples come from the same population.Unlike standard ANOVA, it does not assume normality,and it can be used to test ordinal variables.
• In addition to their standard output, both the Kruskal-Wallis and median tests will display descriptive statisticsand/or quartiles of the test variable.
• A sales manager evaluates two new trainingcourses. Sixty employees, divided into threegroups, all receive standard training. In addition,group 2 receives technical training, and group 3
receives a hands-on tutorial. Each employeewas tested at the end of the training course andtheir score recorded.
• The results are collected in the file
salesperformance.sav . Use the median test toassess the difference in performance betweenthe three groups, if any.
• In this table, for example, the first cell is a countof the number of employees who receivedstandard training and scored above the median.While the null hypothesis would predict thatabout 10 subjects scored above the median,only four subjects in this group did so.
• In addition to standard training, group 2 alsoreceived some technical training. Unlike theother groups, the median for all trainees does
what the null hypothesis says it should do: itnearly divides this group into two equalsubgroups.
• In the final training group, those with exam scoresgreater than the median outnumber those at or below itby a margin of three to one. Like group 1, the nullhypothesis does not provide a good approximation of center for these trainees
• From this two-way frequency table, a chi-square statisticcan be calculated to test the null hypothesis of row andcolumn independence. In fact, the median test is a chi-square test of independence between groupmembership and the proportion of cases above andbelow the median.
• The chi-square value is obtained in the usualfashion for two-way tables. For each cell, thedistance between the observed and expectedcounts is squared, then divided by the expectedvalue. Finally, these quantities are summedacross all cells. For this table, the value is 12.4.
• Degrees of freedom for the frequency table are
equal to (rows - 1) * (columns - 1). In this case,that is 1 * 2 = 2.
• The asymptotic significance tells us how often we canexpect a chi-square value at least as large as 12.4 insimilar repeated samples, if there really is no relationshipbetween the median and group membership. The pFromthis analysis, the manager learns that type of training
resulted in different median scores between the groups.• Trainees who received the hands-on tutorial have a
higher median value than either their counterparts whoreceived standard training or additional technicaltraining.robability is very low: about two times per thousand.
• Agricultural researchers are studying theeffect of mulch color on the taste of crops.Strawberries grown in red, blue, and blackmulch were rated by taste-testers on anordinal scale of one to five (far below to far above average).
• The results are collected in the file
tastetest.sav . Use the Kruskal-Wallis testto determine if taste varies by mulch color.
• The Kruskal-Wallis test uses ranks of the originalvalues and not the values themselves. That'sappropriate in this case, because the scale usedby the taste-testers is ordinal.
• First, each case is ranked without regard togroup membership. Cases tied on a particular value receive the average rank for that value.
After ranking the cases, the ranks are summedwithin groups.
• The Kruskal-Wallis statistic measures how muchthe group ranks differ from the average rank of all groups.
• The chi-square value is obtained by squaringeach group's distance from the average of allranks, weighting by its sample size, summingacross groups, and multiplying by a constant
The degrees of freedom for the chi-squarestatistic are equal to the number of groups minusone.
• The asymptotic significance estimates the probability of obtaining a chi-square statistic greater than or equal tothe one displayed, if there truly are no differencesbetween the group ranks. A chi-square of 9.751 with 2degrees of freedom should occur only about 8 times per
1,000.• The table tells us the ratings of the strawberries differed
by type of mulch used for cultivation. Like the F test instandard ANOVA, Kruskal-Wallis does not tell us howthe groups differed, only that they are different in someway. The Mann-Whitney test could be used for pairwisecomparisons.