Vous êtes sur la page 1sur 120

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.

REGRESSION
Linear Regression estimates the coefficients of the linear equation. To analyze the relationship between variables we select the file employeedata.sav. We will analyze the relationship between the current salary as the dependent variable and education level, previous experience , beginning salary and months since hire as the independent variables.

LOGISTIC REGRESSION
To discuss the procedure for conducting Logistic Regression, we would use the sample file employeedata.sav. The analysis uses as a dependent the attitude variable minority, which is coded 0=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-1
Logistic regression is useful for situations in which you want to be able to predict the presence or absence of a characteristic or outcome based on values of a set of predictor variables. It is similar to a linear regression model but is suited to models where the dependent variable is dichotomous. Logistic regression coefficients can be used to estimate odds ratios for each of the independent variables in the model. Logistic regression is applicable to a broader range of research situations than discriminant analysis.

LOGISTIC REGRESSION-2
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 chisquare, improvement chi-square, classification table, correlations between variables, observed groups and predicted probabilities chart, residual chi-square. For each variable in the equation: coefficient (B), standard error 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 the equation: score statistic, R. For each case: observed group, predicted probability, predicted group, residual, standardized residual.

LOGISTIC REGRESSION-3
Data. The dependent variable should be dichotomous. Independent variables can be interval 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 the same sense that discriminant analysis does. However, your solution may be more stable if your predictors have a multivariate normal distribution. Additionally, as with other forms of regression, multicollinearity among the predictors can lead to biased estimates and inflated standard errors. The procedure is most effective when group membership 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 the continuous variable itself. Related procedures. Use the Scatterplot procedure to screen your data for multicollinearity. If assumptions of multivariate normality and equal variancecovariance matrices are met, you may be able to get a quicker solution using the Discriminant Analysis procedure. If all of your predictor variables are categorical, you can also use the Loglinear procedure. If your dependent variable is continuous, use the Linear Regression procedure. You can use the ROC Curve procedure to plot probabilities saved with the Logistic Regression procedure.

LOGISTIC REGRESSION-4
To Obtain a Logistic Regression Analysis

From the menus choose:


Analyze Regression Binary Logistic...

Select one dichotomous dependent variable. This variable may be numeric or short string. Select one or more covariates. To include interaction terms, select all of the variables involved in the interaction and then select >a*b>.
To enter variables in groups (blocks), select the covariates for a block, and click Next to specify a new block. Repeat until all blocks have been specified. Optionally, you can select cases for analysis. Click Select, choose a selection variable, and click Rule.

NONPARAMETRIC TESTS
A number of nonparametric tests are available, including: The Chi-Square Test The Binomial Test The Runs Test The One-Sample Kolmogorov-Smirnov Test Two-Independent-Samples Tests Tests for Several Independent Samples Two-Related-Samples Tests Tests for Several Related Samples

NONPARAMETRIC CHI-SQUARE
The Chi-Square Test procedure tabulates a variable into categories and tests the hypothesis that the observed frequencies do not differ from their expected values. Chi-Square Test allows you to: Include all categories of the test variable, or limit the test to a specific range. Use standard or customized expected values. Obtain descriptive statistics and/or quartiles on the test variable.

Testing Independence
A large hospital schedules discharge support staff assuming that patients leave the hospital at a fairly constant rate throughout the week. However, because of increasing complaints of staff shortages, the hospital administration wants to determine whether the number of discharges varies by the day of the week. This example uses the file dischargedata.sav . Use Chi-Square Test to test the assumption that patients leave the hospital at a constant rate.

CHI-SQUARE
Each case is a day of the week, and to perform the chi-square test, you must first weight the cases by frequency of patient discharge. To weight the cases, from the Data Editor menus choose: Data Weight Cases...

CHI-SQUARE
Select Weight cases by. Select Average Daily Discharges as the frequency variable. Click OK. The cases are now weighted by frequency of patient discharge.

CHI-SQUARE
To begin the analysis, from the menus choose: Analyze Nonparametric Tests Chi-Square...

CHI-SQUARE
Select Day of the Week as the test variable. Click OK.

Testing a Specific Range


By default, the Chi-Square Test procedure builds frequencies and calculates an expected value based 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 available values. As the next example shows, the procedure easily allows for this. The hospital requests a follow-up analysis: Can staff be scheduled assuming that patients discharged on weekdays only (Monday through Friday) leave at a constant daily rate?

Rerunning the analysis


To rerun the analysis, recall the ChiSquare Test dialog box. Select Use specified range. Type 2 as the lower value and 6 as the upper value. Click OK.

Summary
Using the Chi-Square Test procedure, you found that the rate at which patients are discharged from the hospital is not constant over the course of an average week. This is largely due to greater numbers of discharges on Friday and vastly fewer numbers of discharges on Sunday. When you restricted the range of the test to weekdays, the discharge rates appeared to be more uniform. You may be able to correct staff shortages by adopting separate weekday and weekend staff schedules.

Related Procedures
The Chi-Square Test procedure is useful when you want to compare a single sample from a polychotomous variable to an expected set of values. The procedure tabulates this variable into a set of frequencies and tests this observed set against either a common expected value or a customized set of expected values. The entire range of the test variable is used by default; however, its range 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 alternatively use the Binomial Test procedure.

Binomial Test Procedure


The Binomial Test procedure compares an observed proportion of cases to the proportion expected under a binomial distribution with a specified probability parameter. The observed proportion is defined either by the number of cases having the first value of a dichotomous 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, although this may be changed. To change the probability, you enter a test proportion for the first group. The probability for the second group is equal to 1 minus the probability for the first group. Additionally, descriptive statistics and/or quartiles for the test variable may be displayed.

Comparing Several Distribution


A telecommunications firm loses about 27% of its customers to churn each month. In order to properly focus churn reduction efforts, management wants to know if this percentage varies across predefined customer groups. This information is collected in the file telco.sav . Use the binomial test to determine whether a single rate of churn adequately describes the four major customer types.

Preparing the Data


In order to perform the test, you must first split the file by Customer category. To split the file, from the Data Editor menus choose: Data Split File...

Preparing the Data


Select Compare groups. Select Customer category as the variable on which to base groups. Click OK.

Running the analysis


To begin the analysis, from the menus choose: Analyze Nonparametric Tests Binomial...

Running the analysis


Select Churn within last month as the test variable. Type 0.27 as the test proportion. Click Options. Select Descriptive. Click Continue. Click OK in the Binomial Test dialog box.

Descriptive Statistics Table


Because Churn within last month is a dichotomous variable, the mean tells us the proportion of churn within each customer type. Multiplying these proportions by 100 expresses the same data as percentages.

Contd..
For example, the percentage of churn for customers subscribing only to basic service was 31% Similarly, customers who prefer more high-end electronic services churned at a rate of about 27% within the last month. Similarly, customers who prefer more high-end electronic services churned at a rate of about 27% within the last month.

Contd.
There are about 280 customers who subscribe to a set of convenience services (three-way calling, call forwarding, call waiting, etc.). Of these, only 16% recently churned. Customers who take advantage of all of the services offered by the firm churned the most-37%, or 10% higher than the average of all customers within the last month.

Binomial test Table


Each panel of the binomial test table displays one binomial test. For example, the first panel displays the test of the null hypothesis that the proportion of churn for Basic service users is the same as the proportion of churn in the total sample.

Contd.
Of the 266 Basic service customers, 83 churned within the last month. The Observed Prop. column here shows that these 83 customers account for 31% of the total Basic service group in this sample The test proportion of 0.27 suggests that we should expect 0.27 * 266, or about 72 customers, to have churned.

Contd.
The asymptotic significance value is 0.07, which is above the conventional cutoff for statistical significance (0.05). By that standard, you cannot reject the null hypothesis that the churn rate for basic service customers is equal to the churn rate in the sample at large. The same cannot be said for Plus service customers, however. In this case, the proportion, 0.16, is significantly lower than the test proportion. Many fewer Plus service customers found another service provider last month.

Summary
At the other extreme, significantly more Total service customers were lost last month than the test proportion predicts. Using the Binomial Test procedure, you have determined that the rate of churn differs across customer types. Now that Total Service customers have been identified as high-risk, you can focus further efforts on finding out why these customers are dissatisfied.

Using a Cut Point to Define the Samples


As part of a continuing analysis of churn in their customer base, a telecommunications firm questions whether those who churn tend to be above or below the median household income of $47,000. This example uses the file telco.sav . Use the Binomial Test procedure to dynamically compute and test the proportion of each churn group falling below the median value.

Preparing the Data


In order to perform the test, you must first split the file by Churn within last month. To split the file, from the Data Editor menus choose: Data Split File...

Preparing the Data


Click Reset to restore the default settings. Select Compare groups. Select Churn within last month as the variable to base groups on. Click OK.

Running the Analysis


To begin the analysis, from the menus choose: Analyze Nonparametric Tests Binomial...

Running the Analysis


Click Reset to restore the default settings. Select Household income in thousands as the test variable. Type 47 as the cut point to define the dichotomy Click Options Select Quartiles. Click Continue. Click OK in the Binomial Test dialog box.

Income Quartiles by Churn Group


The descriptives table displays the quartiles for each churn group. Generally, customers who churned last month have lower household incomes.

Binomial Test Table by Churn Group


The binomial test table is split by the values of Churn within last month. The first test selects only those customers in the sample who did not churn last month. Within this first split file group, the cut point has created two groups. The first group consists of those customers who did not churn and whose household income is less than or equal to the median for the total sample.

Binomial Test Table by Churn Group


In these data, just about half of those who did not churn fall at or below median income. As we would expect, the difference in proportions is not significant. However, of those 274 customers who churned last month, the proportion with household incomes at or below the median is significantly different from the null hypothesis value. Those who churn tend to be the less affluent customers.

Summary
Using a cut point to define the groups, you have found that a majority of the customers who churned within the last month fall below the median household income. Now that these customers have been identified as high-risk, you can focus further efforts on determining why these customers are dissatisfied.

Related Procedure
The Binomial Test procedure is useful when you want to compare a single sample from a dichotomous variable to an expected proportion. If the dichotomy does not exist in the data as a variable, one can be dynamically created based upon a cut point on a scale variable. If your variable has more than two outcomes, try the Chi-Square Test procedure. If you want to compare two dichotomous variables, try the McNemar test in the TwoRelated-Samples Tests procedure.

The Runs Test Procedure


Many statistical tests assume that the observations in a sample are independent; in other words, that the order in which the data were collected is irrelevant. If the order does matter, then the sample is not random, and you cannot draw accurate conclusions about the population from which the sample was drawn. Therefore, it is prudent to check the data for a violation of this important assumption. You can use the Runs Test procedure to test whether the order of values of a variable is random. The procedure first classifies each value of the variable as falling above or below a cut point and then tests to ensure that there is no order to the resulting sequence. The cut point is based either on a measure of central tendency ( mean, median, or mode) or a custom value. You can obtain descriptive statistics and/or quartiles of the test variable

Examining Usability Test Results


An e-commerce firm enlisted beta testers to browse and then rate their new Web site. Ratings were recorded as soon as each tester finished browsing. The team is concerned that ratings may be related to the amount of time spent browsing. The ratings are collected in the file siteratings.sav . Use the Runs Test to test the hypothesis that time spent browsing is correlated with site rating.

Determining a Cut Point


A bar chart will help determine the optimal cut point. To create the chart, from the menus choose: Graphs Bar... Select Simple, and then click Define Select Web Site Rating as the category axis. Click OK.

Bar Chart of the Test Variable


The scale for Web Site Rating theoretically ranges from 0 to 20, where 0 = highly unusable and 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 the distribution of ratings is bimodal, with one mode at 8 and the second at 12.

Bar Chart of the Test Variable


Others have argued that the ratings should probably be considered a scale variable and that the median would be a useful cut point. After some discussion, the team decides that randomness will be tested with respect to all three cut points: the median and both modes

Testing Multiple Cut Points


To begin the analysis, from the menus choose: Analyze Nonparametric Tests Runs... Select Web Site Rating as the test variable

Testing Multiple Cut Points


The median is selected by default, so select Mode as a second cut point. Note that the higher of the two modes (12) will be used as the cut point for this test. Finally, select Custom, and type 8 as the third cut point value to test. Click Options.

Testing Multiple Cut Points


Select Descriptive and Quartiles. Click Continue. Click OK in the Runs Test dialog box.

Descriptive Statistics Table


The statistics table will help you understand more about the distribution of ratings in these data. While the default table is very wide, you can easily pivot it to column format. Double-click the table to activate it. From the Viewer menus choose: Pivot Transpose Rows and Columns

32 beta testers completed the task and submitted ratings.

Descriptive Statistics Table


At 9.94, the average rating is almost exactly at the center of the scale. The standard deviation is most useful as an index of variability in normal distributions. However, the runs test does not make any assumptions about normality, and we know from the bar chart that the distribution of ratings is not normal. As we observed in the bar chart, the actual ratings ranged from a low of 6 to a high of 14.

Descriptive Statistics Table


The quartiles tell us that about half of the sample rated the Web site in the range 8 to 12. The median (10) is almost identical to the mean. Although the distribution of ratings is bimodal and not normal, it is also fairly symmetric.

Runs Test Table with a Median Cut Point


The test value is used as a cut point to dichotomize the sample. In this table, the cut point is the sample median. Of 32 testers, 14 scored below the median. Think of them as the "negative" cases The remaining 18 testers scored at or above the median. Think of them as the "positive" cases.

Runs Test Table with a Median Cut Point


The next statistic is a count of the observed runs in the test variable. A run is defined as a sequence of cases on the same side of the cut point. For example, looking at the data, you observe that the first four cases are below the median. This sequence of four "negatives" is the first run. The second run begins at case 5, whose Web site rating is equal to the median

Runs Test Table with a Median Cut Point


The third run begins at case 6, which is again below the median. Counting continues in the same way across all 32 cases in the file. If the order of the ratings is purely random with respect to the median value, you would expect about 17 runs across these 32 cases. Because you observed only 10 runs, the Z statistic is negative.

Runs Test Table with a Median Cut Point


The 2-tailed significance value is the probability of obtaining a Z statistic as or more extreme (in absolute value) than the obtained value, if the order of ratings above and below the median is purely random

Runs Test Table with a Modal Cut Point


In this second test table, the cut point is the mode. Remember that the distribution of ratings is actually bimodal A footnote warns you that the mode being used is the larger of the two data values. The number of cases above and below this cut point stands in contrast to the previous table. Ratings below 12 outnumber those at or above 12 by more than a 2 to 1 margin. This is not surprising, given that 12 is also the 75th percentile

Runs Test Table with a Modal Cut Point


Because it is a function of the number of positive and negative cases, the expected number of runs always depends on the cut point. In this table, the expected number of runs is about 15, which is very close to the observed number. The 2-tailed significance value does not allow you to reject the null hypothesis that the order of the ratings is random with respect to the higher modal value of 12.

Runs Test Table with a Custom Cut Point


The third cut point is the custom value of 8. Recall that this test value is actually the first of the two modes of the distribution. There are 11 observed runs with this cut point. The Z value is 0, indicating that 11 runs were expected by chance alone. As with a mode of 12, we cannot reject the null hypothesis that the order of the ratings above and below the modal value of 8 is random.

Summary
These test tables demonstrate that the results of the runs test may depend on your choice of cut point. In this example, the order of the ratings with respect to the median is not random. On the other hand, the same ratings do not show any order with respect to either modal value. Using the runs test, you discovered that whether the test finds that ratings are related to time spent 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 the site ratings as ordinal. Thus, the results of the two "mode" tests stand, and you can proceed as though the usability scores are independent of time spent browsing.

Related Procedure
You should use the Runs Test procedure when you want to test the hypothesis that the values of a variable are ordered randomly with respect to a cut point of your choosing. The default cut point is the median; however, you can also select the mean, the mode, or even a custom value. Optionally, you can request descriptive statistics and/or quartiles of the test variable. The Runs Test is often used as a precursor to running tests that compare 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.

One-Sample Kolmogorov-Smirnov Procedure


The One-Sample Kolmogorov-Smirnov procedure is used to test the null hypothesis that a sample comes from a particular distribution. It does this by finding the largest difference (in absolute value) between two cumulative distribution functions (CDFs)--one computed directly from the data; the other, from mathematical theory. Four theoretical distribution functions are available-- normal, uniform, Poisson, and exponential. Optionally, descriptive statistics and/or quartiles of the test variable can be displayed.

Assessing Goodness of Fit


An insurance analyst wants to model the number of automobile accidents per driver. She has randomly sampled data on drivers in a certain region and uses the Kolmogorov-Smirnov test to confirm that the number of accidents follows a Poisson distribution. This example uses the file autoaccidents.sav .

Running the Analysis


To begin the analysis, from the menus choose: Analyze Nonparametric Tests 1-Sample K-S... Select Number of accidents past 5 years as the test variable. Deselect Normal, and select Poisson as the test distribution. Click OK.

One-Sample Kolmogorov-Smirnov Test Table


The distribution is based on data from 500 randomly sampled drivers. The sample size figures into the test statistic below. The Poisson distribution is indexed by only one parameter--the mean. This sample of drivers averaged about 1.72 accidents over the past five years.

One-Sample Kolmogorov-Smirnov Test Table


The next three rows fall under the general category Most Extreme Differences. The differences referred to are the largest positive and negative points of divergence between the empirical and theoretical CDFs. The first difference value, labeled Absolute, is the absolute value of the larger of the two difference values printed directly below it. This value will be required to calculate the test statistic

One-Sample Kolmogorov-Smirnov Test Table


The Positive difference is the point at which the empirical CDF exceeds the theoretical CDF by the greatest amount. At the opposite end of the continuum, the Negative difference is the point at which the theoretical CDF exceeds the empirical CDF by the greatest amount.

One-Sample Kolmogorov-Smirnov Test Table


The Z test statistic is the product of the square root of the sample size and the largest absolute difference between the empirical and theoretical CDFs. Unlike much statistical testing, a significant result here is bad news. The probability of the Z statistic is below 0.05, meaning that the Poisson distribution with a parameter of 1.72 is not a good fit for the number of accidents within the past five years in this sample of drivers.

Goodness of Fit within Groups


Generally, a significant Kolmogorov-Smirnov test means one of two things--either the theoretical distribution is not appropriate, or an incorrect parameter was used to generate that distribution. Looking at the previous results, it is hard for the analyst to believe that the Poisson distribution is not the appropriate one to use for modeling automobile 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. The total sample average assumes that males and females have equal numbers of accidents, but this is probably not true. She will split the sample by gender, using each gender's average as the Poisson parameter in separate tests.

Splitting the File


To split the file, from the Data Editor menus choose: Data Split file... Select Compare groups. Select Sex of insured as the test variable. Click OK.

Running the Analysis


To rerun the one-sample K-S test, recall the One-Sample Kolmogorov-Smirnov Text dialog box. Although the dialog box need not be reset, the analyst would like to obtain descriptive statistics on the test variable within each group. Click Options. Select Descriptive. Click Continue. Click OK in the One-Sample KolmogorovSmirnov Test dialog box.

Descriptive Statistics by Group


The statistics table provides evidence that a single Poisson parameter for both genders may not be correct. Males in this sample averaged about two accidents over the past five years, while females tended to have fewer accidents.

Test Tables by Group


When assessing goodness of fit, remember that a statistically significant Z statistic means that the chosen distribution does not fit the data well. Unlike the previous test, however, we see a much better fit when splitting the file by gender.

Test Tables by Group


Increasing the Poisson parameter from 1.72 to 1.98 clearly provides a better fit to the accident data for men Similarly, decreasing the Poisson parameter from 1.72 to 1.47 provides a better fit to the accident data for women.

SUMMARY
Using the One-Sample Kolmogorov-Smirnov Test procedure, you found that, overall, the number of automobile accidents per driver do not follow a Poisson distribution. However, once you split the file on gender, the distributions of accidents for males and females can individually be considered Poisson. These results demonstrate that the one-sample Kolmogorov-Smirnov test requires not only that you choose the appropriate distribution but the appropriate parameter (s) for it as well.

Related Procedures
You can use the one-sample Kolmogorov-Smirnov procedure to test the null hypothesis that a sample comes from a particular distribution. Four theoretical distribution functions are available--normal, uniform, Poisson, and exponential. Optionally, you can request descriptive 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 the Two-Independent-Samples Tests procedure. If your variable is scale, more statistics and tests of normality are available through the Explore procedure.

Nonparametric Tests for Two Independent Samples


The nonparametric tests for two independent samples are useful for determining whether or not the values of a particular variable differ between two groups. This is especially true when the assumptions of the t test are not met.

Methods for Two Independent Samples


When you want to test for differences between two groups, the independent-samples t test comes naturally to mind. However, despite its simplicity, power, and robustness, the independent-samples t test is invalid when certain critical assumptions are not met. These assumptions center around the parameters of the test variable (in this case, 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 is calculated using squared distances from the mean, it too is invalid if those distances are 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 that assumes normality. If any of these circumstances is true for your analysis, you should consider using the nonparametric procedures designed to test for the significance of the difference between two groups. They are called nonparametric because they make no assumptions about the parameters of a distribution, nor do they assume that any particular distribution is being used. Two popular nonparametric tests of location (or central tendency)--the Mann-Whitney and Wilcoxon tests--and a test of location and shape--the two-sample Kolmogorov-Smirnov test--are illustrated.

Methods for Two Independent Samples


Mann-Whitney and Wilcoxon tests. You can use the Mann-Whitney and Wilcoxon statistics to test the null hypothesis that two independent samples come from the same population. Their advantage over the independent-samples t test is that MannWhitney and Wilcoxon do not assume normality and can be used to test ordinal variables. Two-sample Kolmogorov-Smirnov test. Alternatively, you can use the two-sample Kolmogorov-Smirnov test to test the null hypothesis that two samples have the same distribution. The test variable is assumed to be continuous; however, its cumulative distribution function (CDF) can assume any shape at all. In addition to their standard output, the Mann-Whitney and Wilcoxon and the two-sample Kolmogorov-Smirnov tests display descriptive statistics and/or quartiles of the test variable.

Using the Mann-Whitney Test to Test Ordinal Outcomes


Physicians randomly assigned female stroke patients to receive only physical therapy or physical therapy combined with emotional therapy. Three months after the treatments, the Mann-Whitney test is used to compare each group's ability to perform common activities of daily life. The results are collected in the file adl.sav . Use the Mann-Whitney test to determine whether the two groups' abilities differ.

Running the Analysis


To begin the analysis, from the menus choose: Analyze Nonparametric Tests 2 Independent Samples Select Travel ADL, Cooking ADL, and Housekeeping ADL as the test variables. Select Treatment group as the grouping variable. Click Define Groups

Running the Analysis


Type 0 as the group 1 value and 1 as the group 2 value. Click Continue. Click OK in the Two-IndependentSamples Tests dialog box.

Rank Table
Because the test variables are assumed to be ordinal, the Mann-Whitney and Wilcoxon tests are based on ranks of the original values and not on the values themselves. The rank table is divided into three panels, one panel for each test variable

Rank Table
The first test variable, Travel ADL, measures the ability to regularly get around the community. It ranges from 0 to 4, where 0 = Same as before illness and 4 = Bedridden. All 46 women in the control group and all 54 women in the treatment group provided valid data for this variable. First, each case is ranked without regard to group membership. Cases tied on a particular value receive the average rank for that value. After ranking the cases, the ranks are summed within groups.

Rank Table
Average ranks adjust for differences in the number of patients in both groups. If the groups are only randomly different, the average ranks should be about equal. For Travel ADL, the average ranks are over 9 points apart. The test variables Cooking ADL and Housekeeping ADL contain missing data. For these variables, the value 4 = Never did any; thus, these scales do not apply to all patients.

However, for those to whom they do apply, there are differences of about 12 to 13 points between the average ranks of the treatment and control groups.

Mann-Whitney and Wilcoxon Tests Table


The U statistic is simple (but tedious) to calculate. 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 is repeated for group 2. The Mann-Whitney U statistic 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 are the rank sums for the treatment group.

Mann-Whitney and Wilcoxon Tests Table


A nice feature of the Mann-Whitney and Wilcoxon tests is that the Z statistic and normal distribution provide an excellent approximation as the sample size grows beyond 10 in either group. The negative Z statistics indicate that the rank sums are lower than their expected values. Each two-tailed significance value estimates the probability of obtaining a Z statistic as or more extreme (in absolute value) as the one displayed, if there truly is no effect of the treatment.

Mann-Whitney and Wilcoxon Tests Table


The significantly lower rank sums of the treatment group indicate to the physicians that the additional emotional therapy had some beneficial effect on such activities of daily life as cooking and cleaning.

Using the Two-Sample Kolmogorov-Smirnov Test to

Compare Distributions

A grain processor has two corn crops with aflatoxin levels below 20 parts per billion and are safe for human consumption. However, because aflatoxin varies widely across yields, he wants to compare the levels of aflatoxin in each of the yields. This example uses the file aflatoxin20.sav . Use the two-sample Kolmogorov-Smirnov test to determine whether the distribution of aflatoxin differs significantly between the two safe yields.

Preparing the Data


To center Aflatoxin PPB, from the Data Editor menus choose: Transform Compute... Type ctrtoxin as the target variable. Click Type&Label Type Centered aflatoxin level as the label. Click Continue Click If in the Compute Variable dialog box.

Preparing the Data


Select Include if case satisfies condition. Type yield=4 in the expression area. Click Continue. The mean aflatoxin level for yield 4 is 14.6875, so type toxin - 14.6875 in the expression area. Click OK. That takes care of yield 4, but yield 8 remains. Recall the Compute Variable dialog box. Click If in the Compute Variable dialog box.

Preparing the Data


Type yield=8 in the expression area. Click Continue Type toxin - 8.4375 in the expression area. Click OK. Click OK to finish centering the variable

Running the Analysis


To begin the analysis, from the menus choose: Analyze Select Corn yield as the grouping variable. Nonparametric Tests Click Define Groups. 2 Independent Samples Select Aflatoxin PPB and Centered aflatoxin level as the test variables. Deselect Mann-Whitney U, and select Kolmogorov-Smirnov Z. Select Corn yield as the grouping variable.

Running the Analysis


Type 4 as the group 1 value and 8 as the group 2 value. Click Continue. Click OK in the Two-IndependentSamples Tests dialog box.

Two-Sample K-S Frequency Table


The frequency table confirms that there are 16 cases for each corn yield. In this example, the sample sizes of the two groups are equal, although this is not required.

Two-Sample K-S Test Table


The first three rows of the test table fall under the general category Most Extreme Differences. The differences referred to are the largest positive and negative points of divergence between the CDFs of the two sample distributions. The first difference value, labeled Absolute, is the absolute value of the larger of the two difference values printed directly below it. This value will be required to calculate the test statistic

Two-Sample K-S Test Table


The Positive difference is the point at which the CDF for yield 8 exceeds the CDF for yield 4 by the greatest amount. It is 0 in this case, meaning that the distribution of aflatoxin in yield 8 never exceeds that of yield 4. At the opposite end of the continuum, the Negative difference is the point at which the CDF for yield 4 exceeds the CDF for yield 8 by the greatest amount. The Z test statistic is a function of the combined sample size and the largest absolute difference between the two cumulative distribution functions.

Two-Sample K-S Test Table


The probability of the Kolmogorov-Smirnov Z statistic falls well below 0.05. By that standard, the distributions of the two yields are significantly different from each other. On the other hand, the Z statistic and associated significance value for Centered toxin level confirm that the shape of the two distributions is not significantly different

Two-Sample K-S Test Table


From this table, we can conclude that the significance of the difference between the two distributions is due only to their different locations on the scale, not to any differences in shape.

Related Procedures
You should use the Mann-Whitney test when you want to test for differences between two groups but you are testing an ordinal variable or you have a scale variable that in some other ways does not conform to the assumptions of the independent-samples t test. The Mann-Whitney and Wilcoxon tests assume that the variable you are testing is at least ordinal and that its distribution is similar in both groups. You can use the two-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 is assumed for the underlying distribution. However, because the test makes no assumptions, it is sensitive to differences in both location and scale. You may want to center 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 between two 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 TwoRelated-Samples Tests procedure.

Nonparametric Tests for Multiple Independent Samples


The nonparametric tests for multiple independent samples are useful for determining whether or not the values of a particular variable differ between two or more groups. This is especially true when the assumptions of ANOVA are not met.

Methods for Multiple Independent Samples


Although one-way analysis of variance (ANOVA) is the method of choice when testing for differences between multiple groups, it assumes that the mean is a valid estimate of center and that the distribution of the test variable is reasonably normal and similar in all groups. However, when your test variable is ordinal, the mean is not a valid estimate because the distances between the values are arbitrary. Even if the mean is valid, the distribution of the test variable may be so non-normal that it makes you suspicious of any test that assumes normality. When the assumptions behind the standard ANOVA are invalid or suspect, you should consider using the nonparametric procedures designed to test for the significance of the difference between multiple groups. They are called nonparametric because they make no assumptions about the parameters (such as the mean and variance) of a distribution, nor do they assume that any particular distribution is being used. In this chapter, we discuss two nonparametric tests for multiple independent samples, the KruskalWallis and median tests.

Methods for Multiple Independent Samples


The median method tests the null hypothesis that two or more independent samples have the same median. It assumes nothing about the distribution of the test variable, making it a good choice when you suspect that the distribution varies by group. The Kruskal-Wallis test is a one-way analysis of variance by ranks. It tests the null hypothesis that multiple independent 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 KruskalWallis and median tests will display descriptive statistics and/or quartiles of the test variable.

Using the Median Test to Detect Group Differences


A sales manager evaluates two new training courses. Sixty employees, divided into three groups, all receive standard training. In addition, group 2 receives technical training, and group 3 receives a hands-on tutorial. Each employee was tested at the end of the training course and their score recorded. The results are collected in the file salesperformance.sav . Use the median test to assess the difference in performance between the three groups, if any.

Obtaining the Analysis


To begin the analysis, from the menus choose: Analyze Nonparametric Tests K Independent Samples... Select Score on training exam as the test variable. Deselect Kruskal-Wallis H, and select Median as the test type. Select Sales training group as the grouping variable. Click Define Range

Obtaining the Analysis


Type 1 as the minimum and 3 as the maximum values. Click Continue. Click Options in the Tests for Several Independent Samples dialog box. Select Quartiles in the Statistics group. Click Continue. Click OK in the Tests for Several Independent Samples dialog box.

Median Test Statistics Table


Across all 60 subjects, the median performance on the exam is a score just below 75. The null hypothesis for the median test is that this particular value is a good approximation of center for each of the three training groups.

Median Test Frequency Table


To test this hypothesis, each group is divided into two subgroups: those whose scores fall at or below the median, and those whose scores are above it. The result is a two-way frequency table with two rows and g columns, where g is the number of categories in your grouping variable.

Median Test Frequency Table


In this table, for example, the first cell is a count of the number of employees who received standard training and scored above the median. While the null hypothesis would predict that about 10 subjects scored above the median, only four subjects in this group did so. In addition to standard training, group 2 also received some technical training. Unlike the other groups, the median for all trainees does what the null hypothesis says it should do: it nearly divides this group into two equal subgroups.

Median Test Frequency Table


In the final training group, those with exam scores greater than the median outnumber those at or below it by a margin of three to one. Like group 1, the null hypothesis does not provide a good approximation of center for these trainees From this two-way frequency table, a chi-square statistic can be calculated to test the null hypothesis of row and column independence. In fact, the median test is a chisquare test of independence between group membership and the proportion of cases above and below the median.

Median Test Table


The chi-square value is obtained in the usual fashion for two-way tables. For each cell, the distance between the observed and expected counts is squared, then divided by the expected value. Finally, these quantities are summed across 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.

Median Test Table


The asymptotic significance tells us how often we can expect a chi-square value at least as large as 12.4 in similar repeated samples, if there really is no relationship between the median and group membership. The pFrom this 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 who received standard training or additional technical training.robability is very low: about two times per thousand.

Median Test Table


From this 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 who received standard training or additional technical training.

Using Kruskal-Wallis to Test Ordinal Outcomes


Agricultural researchers are studying the effect of mulch color on the taste of crops. Strawberries grown in red, blue, and black mulch were rated by taste-testers on an ordinal scale of one to five (far below to far above average). The results are collected in the file tastetest.sav . Use the Kruskal-Wallis test to determine if taste varies by mulch color.

Running the Analysis


To begin the analysis, from the menus choose: Analyze Nonparametric Tests K Independent Samples Select Taste scale as the test variable. Select Mulch color as the grouping variable. Click Define Range.

Running the Analysis


Type 1 as the minimum and 3 as the maximum values. Click Continue. Click OK in the Tests for Several Independent Samples dialog box.

Kruskal-Wallis Rank Table


The Kruskal-Wallis test uses ranks of the original values and not the values themselves. That's appropriate in this case, because the scale used by the taste-testers is ordinal. First, each case is ranked without regard to group membership. Cases tied on a particular value receive the average rank for that value. After ranking the cases, the ranks are summed within groups.

Kruskal-Wallis Test Table


The Kruskal-Wallis statistic measures how much the group ranks differ from the average rank of all groups. The chi-square value is obtained by squaring each group's distance from the average of all ranks, weighting by its sample size, summing across groups, and multiplying by a constant The degrees of freedom for the chi-square statistic are equal to the number of groups minus one.

Kruskal-Wallis Test Table


The asymptotic significance estimates the probability of obtaining a chi-square statistic greater than or equal to the one displayed, if there truly are no differences between the group ranks. A chi-square of 9.751 with 2 degrees 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 in standard ANOVA, Kruskal-Wallis does not tell us how the groups differed, only that they are different in some way. The Mann-Whitney test could be used for pairwise comparisons.

Vous aimerez peut-être aussi