SPSS Instructions for Introduction to BiostatisticsLarry WinnerDepartment of StatisticsUniversity of Florida
SPSS WindowsData ViewUsed to display dataColumns represent variablesRows represent individual units or groups of units that share common values of variablesVariable ViewUsed to display information on variables in datasetTYPE: Allows for various styles of displayingLABEL: Allows for longer description of variable nameVALUES: Allows for longer description of variable levelsMEASURE: Allows choice of measurement scale Output ViewDisplays Results of analyses/graphs
Data Entry Tips IFor variables that are not identifiers (such as name, county, school, etc), use numeric values for levels and use the VALUES option in VARIABLE VIEW to give their levels. Some procedures require numeric labels for levels. SPSS will print the VALUES on outputFor large datasets, use a spreadsheet such as EXCEL which is more flexible for data entry, and import the file into SPSSGive descriptive LABEL to variable names in the VARIABLE VIEWKeep in mind that Columns are Variables, you dont want multiple columns with the same variable
Data Entry/Analysis Tips IIWhen re-analyzing previously published data, it is often possible to have only a few outcomes (especially with categorical data), with many individuals sharing the same outcomes (as in contingency tables)For ease of data entry:Create one line for each combination of factor levelsCreate a new variable representing a COUNT of the number of individuals sharing this outcomeWhen analyzing data Click on:DATA WEIGHT CASES WEIGHT CASES BYClick on the variable representing COUNTAll subsequent analyses treat that outcome as if it occurred COUNT times
Example 1.3 - Grapefruit Juice Study To import an EXCEL file, click on:FILE OPEN DATA then change FILES OF TYPE to EXCEL (.xls)
To import a TEXT or DATA file, click on: FILE OPEN DATA then change FILES OF TYPE to TEXT (.txt) or DATA (.dat)You will be prompted through a series of dialog boxes to import dataset
Sheet1
crcl
38
66
74
99
80
64
80
120
Sheet2
Sheet3
Descriptive Statistics-Numeric DataAfter Importing your dataset, and providing names to variables, click on:ANALYZE DESCRIPTIVE STATISTICS DESCRIPTIVESChoose any variables to be analyzed and place them in box on rightOptions include:
Example 1.3 - Grapefruit Juice Study
Descriptive Statistics-General DataAfter Importing your dataset, and providing names to variables, click on:ANALYZE DESCRIPTIVE STATISTICS FREQUENCIESChoose any variables to be analyzed and place them in box on rightOptions include (For Categorical Variables):Frequency Tables Pie Charts, Bar Charts Options include (For Numeric Variables)Frequency Tables (Useful for discrete data)Measures of Central Tendency, Dispersion, PercentilesPie Charts, Histograms
Example 1.4 - Smoking Status
Vertical Bar Charts and Pie ChartsAfter Importing your dataset, and providing names to variables, click on:GRAPHS BAR SIMPLE (Summaries for Groups of Cases) DEFINEBars Represent N of Cases (or % of Cases)Put the variable of interest as the CATEGORY AXIS
GRAPHS PIE (Summaries for Groups of Cases) DEFINESlices Represent N of Cases (or % of Cases)Put the variable of interest as the DEFINE SLICES BY
Example 1.5 - Antibiotic Study
HistogramsAfter Importing your dataset, and providing names to variables, click on:GRAPHS HISTOGRAMSelect Variable to be plottedClick on DISPLAY NORMAL CURVE if you want a normal curve superimposed (see Chapter 3).
Example 1.6 - Drug Approval Times
Side-by-Side Bar ChartsAfter Importing your dataset, and providing names to variables, click on:GRAPHS BAR Clustered (Summaries for Groups of Cases) DEFINEBars Represent N of Cases (or % of Cases)CATEGORY AXIS: Variable that represents groups to be compared (independent variable)DEFINE CLUSTERS BY: Variable that represents outcomes of interest (dependent variable)
Example 1.7 - Streptomycin Study
ScatterplotsAfter Importing your dataset, and providing names to variables, click on:GRAPHS SCATTER SIMPLE DEFINEFor Y-AXIS, choose the Dependent (Response) Variable For X-AXIS, choose the Independent (Explanatory) Variable
Example 1.8 - Theophylline Clearance
Scatterplots with 2 Independent VariablesAfter Importing your dataset, and providing names to variables, click on:GRAPHS SCATTER SIMPLE DEFINEFor Y-AXIS, choose the Dependent Variable For X-AXIS, choose the Independent Variable with the most levelsFor SET MARKERS BY, choose the Independent Variable with the fewest levels
Example 1.8 - Theophylline Clearance
Contingency Tables for Conditional ProbabilitiesAfter Importing your dataset, and providing names to variables, click on:ANALYZE DESCRIPTIVE STATISTICS CROSSTABSFor ROWS, select the variable you are conditioning on (Independent Variable)For COLUMNS, select the variable you are finding the conditional probability of (Dependent Variable)Click on CELLSClick on ROW Percentages
Example 1.10 - Alcohol & Mortality
Independent Sample t-TestAfter Importing your dataset, and providing names to variables, click on:ANALYZE COMPARE MEANS INDEPENDENT SAMPLES T-TESTFor TEST VARIABLE, Select the dependent (response) variable(s)For GROUPING VARIABLE, Select the independent variable. Then define the names of the 2 levels to be compared (this can be used even when the full dataset has more than 2 levels for independent variable).
Example 3.5 - Levocabastine in Renal Patients
Wilcoxon Rank-Sum/Mann-Whitney TestsAfter Importing your dataset, and providing names to variables, click on:ANALYZE NONPARAMETRIC TESTS 2 INDEPENDENT SAMPLES For TEST VARIABLE, Select the dependent (response) variable(s)For GROUPING VARIABLE, Select the independent variable. Then define the names of the 2 levels to be compared (this can be used even when the full dataset has more than 2 levels for independent variable).Click on MANN-WHITNEY U
Example 3.6 - Levocabastine in Renal Patients
Paired t-testAfter Importing your dataset, and providing names to variables, click on:ANALYZE COMPARE MEANS PAIRED SAMPLES T-TESTFor PAIRED VARIABLES, Select the two dependent (response) variables (the analysis will be based on first variable minus second variable)
Example 3.7 - Cmax in SRC&IRC Codeine
Wilcoxon Signed-Rank TestAfter Importing your dataset, and providing names to variables, click on:ANALYZE NONPARAMETRIC TESTS 2 RELATED SAMPLESFor PAIRED VARIABLES, Select the two dependent (response) variables (be careful in determining which order the differences are being obtained, it will be clear on output)Click on WILCOXON Option
Example 3.8 - t1/2SS in SRC&IRC Codeine
Relative Risks and Odds RatiosAfter Importing your dataset, and providing names to variables, click on:ANALYZE DESCRIPTIVE STATISTICS CROSSTABSFor ROWS, Select the Independent VariableFor COLUMNS, Select the Dependent VariableUnder STATISTICS, Click on RISKUnder CELLS, Click on OBSERVED and ROW PERCENTAGESNOTE: You will want to code the data so that the outcome present (Success) category has the lower value (e.g. 1) and the outcome absent (Failure) category has the higher value (e.g. 2). Similar for Exposure present category (e.g. 1) and exposure absent (e.g. 2). Use Value Labels to keep output straight.
Example 5.1 - Pamidronate Study
Example 5.2 - Lip Cancer
Fishers Exact TestAfter Importing your dataset, and providing names to variables, click on:ANALYZE DESCRIPTIVE STATISTICS CROSSTABSFor ROWS, Select the Independent VariableFor COLUMNS, Select the Dependent VariableUnder STATISTICS, Click on CHI-SQUAREUnder CELLS, Click on OBSERVED and ROW PERCENTAGESNOTE: You will want to code the data so that the outcome present (Success) category has the lower value (e.g. 1) and the outcome absent (Failure) category has the higher value (e.g. 2). Similar for Exposure present category (e.g. 1) and exposure absent (e.g. 2). Use Value Labels to keep output straight.
Example 5.5 - Antiseptic Experiment
McNemars TestAfter Importing your dataset, and providing names to variables, click on:ANALYZE DESCRIPTIVE STATISTICS CROSSTABSFor ROWS, Select the outcome for condition/time 1For COLUMNS, Select the outcome for condition/time 2Under STATISTICS, Click on MCNEMARUnder CELLS, Click on OBSERVED and TOTAL PERCENTAGESNOTE: You will want to code the data so that the outcome present (Success) category has the lower value (e.g. 1) and the outcome absent (Failure) category has the higher value (e.g. 2). Similar for Exposure present category (e.g. 1) and exposure absent (e.g. 2). Use Value Labels to keep output straight.
Example 5.6 - Report of Implant LeakP-value
Cochran Mantel-Haenszel TestAfter Importing your dataset, and providing names to variables, click on:ANALYZE DESCRIPTIVE STATISTICS CROSSTABSFor ROWS, Select the Independent VariableFor COLUMNS, Select the Dependent VariableFor LAYERS, Select the Strata VariableUnder STATISTICS, Click on COCHRANS AND MANTEL-HAENSZEL STATISTICSNOTE: You will want to code the data so that the outcome present (Success) category has the lower value (e.g. 1) and the outcome absent (Failure) category has the higher value (e.g. 2). Similar for Exposure present category (e.g. 1) and exposure absent (e.g. 2). Use Value Labels to keep output straight.
Example 5.7 Smoking/Death by Age
Chi-Square TestAfter Importing your dataset, and providing names to variables, click on:ANALYZE DESCRIPTIVE STATISTICS CROSSTABSFor ROWS, Select the Independent VariableFor COLUMNS, Select the Dependent VariableUnder STATISTICS, Click on CHI-SQUAREUnder CELLS, Click on OBSERVED, EXPECTED, ROW PERCENTAGES, and ADJUSTED STANDARDIZED RESIDUALSNOTE: Large ADJUSTED STANDARDIZED RESIDUALS (in absolute value) show which cells are inconsistent with null hypothesis of independence. A common rule of thumb is seeing which if any cells have values >3 in absolute value
Example 5.8 - Marital Status & Cancer
Goodman & Kruskals g / Kendalls tbAfter Importing your dataset, and providing names to variables, click on:ANALYZE DESCRIPTIVE STATISTICS CROSSTABSFor ROWS, Select the Independent VariableFor COLUMNS, Select the Dependent VariableUnder STATISTICS, Click on GAMMA and KENDALLS tb
Examples 5.9,10 - Nicotine Patch/Exhaustion
Kruskal-Wallis TestAfter Importing your dataset, and providing names to variables, click on:ANALYZE NONPARAMETRIC TESTS k INDEPENDENT SAMPLESFor TEST VARIABLE, Select Dependent VariableFor GROUPING VARIABLE, Select Independent Variable, then define range of levels of variable (Minimum and Maximum) Click on KRUSKAL-WALLIS H
Example 5.11 - Antibiotic DeliveryNote: This statistic makes the adjustment for ties. See Hollander and Wolfe (1973), p. 140.
Cohens kAfter Importing your dataset, and providing names to variables, click on:ANALYZE DESCRIPTIVE STATISTICS CROSSTABSFor ROWS, Select Rater 1For COLUMNS, Select Rater 2Under STATISTICS, Click on KAPPAUnder CELLS, Click on TOTAL Percentages to get the observed percentages in each cell (the first number under observed count in Table 5.17).
Example 5.12 - Siskel & Ebert
1-Factor ANOVA - Independent Samples (Parallel Groups)After Importing your dataset, and providing names to variables, click on:ANALYZE COMPARE MEANS ONE-WAY ANOVAFor DEPENDENT LIST, Click on the Dependent VariableFor FACTOR, Click on the Independent VariableTo obtain Pairwise Comparisons of Treatment Means:Click on POST HOCThen TUKEY and BONFERRONI (among many other choices)
Examples 6.1,2 - HIV Clinical Trial
Kruskal-Wallis TestAfter Importing your dataset, and providing names to variables, click on:ANALYZE NONPARAMETRIC TESTS k INDEPENDENT SAMPLESFor TEST VARIABLE, Select Dependent VariableFor GROUPING VARIABLE, Select Independent Variable, then define range of levels of variable (Minimum and Maximum) Click on KRUSKAL-WALLIS H
Example 6.2(a) - Thalidomide and HIV-1
Randomized Block Design - F-testAfter Importing your dataset, and providing names to variables, click on:ANALYZE GENERAL LINEAR MODEL UNIVARIATEAssign the DEPENDENT VARIABLEAssign the TREATMENT variable as a FIXED FACTORAssign the BLOCK variable as a RANDOM FACTORClick on MODEL, then CUSTOM, under BUILD TERMS choose MAIN EFFECTS, move both factors to MODEL listClick on POST HOC and select the TREATMENT factor for POST HOC TESTS and BONFERRONI and TUKEY (among many choices)For PLOTS, Select the BLOCK factor for HORIZONTAL AXIS and the TREATMENT factor for SEPARATE LINES, click ADD
Example 6.3 - Theophylline Clearance
Example 6.3 - Theophylline Clearance
Randomized Block Design - Friedmans testAfter Importing your dataset, and providing names to variables, click on:ANALYZE NONPARAMETRIC TESTS k RELATED SAMPLESFor TEST VARIABLES, select the variables representing the treatments (each line is a subject/block)Click on FRIEDMAN
Example 6.4 - Absorption of Valproate DepakoteNote: This makes an adjustment for ties, see Hollander and Wolfe (1973), p. 140.
2-Way ANOVAAfter Importing your dataset, and providing names to variables, click on:ANALYZE GENERAL LINEAR MODEL UNIVARIATEAssign the DEPENDENT VARIABLEAssign the FACTOR A variable as a FIXED FACTORAssign the FACTOR B variable as a FIXED FACTORClick on MODEL, then CUSTOM, select FULL FACTORIALClick on POST HOC and select the both factors for POST HOC TESTS and BONFERRONI and TUKEY (among many choices)For PLOTS, Select FACTOR B for HORIZONTAL AXIS and FACTOR A for SEPARATE LINES, click ADD
Example 6.5 - Nortriptyline Clearance
Linear RegressionAfter Importing your dataset, and providing names to variables, click on:ANALYZE REGRESSION LINEARSelect the DEPENDENT VARIABLESelect the INDEPENDENT VARAIABLE(S)Click on STATISTICS, then ESTIMATES, CONFIDENCE INTERVALS, MODEL FITFor histogram of residuals, click on PLOTS, and HISTOGRAM under STANDARDIZED RESIDUAL PLOTS
Examples 7.1-7.6 - Gemfibrozil Clearance
Examples 7.1-7.6 - Gemfibrozil Clearance
Example 7.8 - TB/Thalidomide in HIV
Useful Regression PlotsScatterplot with Fitted (Least Squares) LineGRAPHS INTERACTIVE SCATTERPLOTSelect DEPENDENT VARIABLE for UP/DOWN AXISSelect INDEPENDENT VARIABLE for RIGHT/LEFT AXISClick on FIT Tab, then REGRESSION for METHOD NOTE: Be certain both variables are SCALE in VARIABLE VIEW under MEASUREPartial Regression Plots (Multiple Regression) to observe association of each Independent Variable with Y, controlling for all othersFit REGRESSION model with all Independent VariablesClick PLOTS, then PRODUCE ALL PARTIAL PLOTS
Example 7.1 - Gemfibrozil Scatterplot
Logistic RegressionAfter Importing your dataset, and providing names to variables, click on:ANALYZE REGRESSION BINARY LOGISTICSelect the DEPENDENT VARIABLESelect the INDEPENDENT VARAIABLE(S) as COVARIATESFor a 95% CI for the odds ratio, click on OPTIONS, then CI for exp(B)Declare any CATEGORICAL COVARIATES (Independent variables whose levels are categorical, not numeric)
Example 8.1 - Navelbine ToxicityOmnibus test for all regression coefficients (like F in linear regression)
Example 8.2 - CHD, BP, Cholesterol
Nonlinear RegressionAfter Importing your dataset, and providing names to variables, click on:ANALYZE REGRESSION NONLINEARSelect the DEPENDENT VARIABLEDefine the MODEL EXPRESSION as a function of the INDEPENDENT VARIABLE(s) and unknown PARAMETERSDefine the PARAMETERS and give them STARTING VALUES (this may take several attempts)
Example 8.3 - MK-639 in AIDS PatientsNonlinear Regression Summary Statistics Dependent Variable RNACHNG
Source DF Sum of Squares Mean Square
Regression 3 24.97099 8.32366 Residual 2 .02783 .01391 Uncorrected Total 5 24.99881
(Corrected Total) 4 10.83973
R squared = 1 - Residual SS / Corrected SS = .99743
Asymptotic 95 % Asymptotic Confidence Interval Parameter Estimate Std. Error Lower Upper
A 3.521788512 .121466117 2.999161991 4.044415032 B 35.598069675 7.532265897 3.189345253 68.006794097 C 18374.392967 82.899219276 18017.706415 18731.079519
Survival Analysis -Kaplan-Meier Estimates and Log-Rank TestAfter Importing your dataset, and providing names to variables, click on:ANALYZE SURVIVAL KAPLAN-MEIERSelect the variable representing the survival TIME of individualSelect the variable representing the STATUS of individual (whether or not event has occured). NOTE: If the variable is an indicator that the observation was CENSORED, then a value of 0 for that variable will mean the event has occured. Select the variable representing the FACTOR containing the groups to be comparedClick on COMPARE FACTOR, select LOG-RANK, and POOL ACROSS STRATA
Examples 9.1-2 - Navelbine and Taxol in MiceSurvival Analysis for TIME
Factor REGIMEN = 1
Time Status Cumulative Standard Cumulative Number Survival Error Events Remaining
6 0 .9796 .0202 1 48 8 0 .9592 .0283 2 47 22 0 .9388 .0342 3 46 32 0 4 45 32 0 .8980 .0432 5 44 35 0 .8776 .0468 6 43 41 0 .8571 .0500 7 42 46 0 .8367 .0528 8 41 54 0 .8163 .0553 9 40Factor REGIMEN = 2
Time Status Cumulative Standard Cumulative Number Survival Error Events Remaining
8 0 .9333 .0644 1 14 10 0 .8667 .0878 2 13 27 0 .8000 .1033 3 12 31 0 .7333 .1142 4 11 34 0 .6667 .1217 5 10 35 0 .6000 .1265 6 9 39 0 .5333 .1288 7 8 47 0 .4667 .1288 8 7 57 0 .4000 .1265 9 6
Examples 9.1-2 - Navelbine and Taxol in MiceTest Statistics for Equality of Survival Distributions for REGIMEN Statistic df Significance Log Rank 10.93 1 .0009This is the square of the Z-statistic in text, and is a chi-square statistic
Relative Risk Regression (Cox Model)After Importing your dataset, and providing names to variables, click on:ANALYZE SURVIVAL COX REGRESSIONSelect the variable representing the survival TIME of individualSelect the variable representing the STATUS of individual (whether or not event has occured). NOTE: If the variable is an indicator that the observation was CENSORED, then a value of 0 for that variable will mean the event has occured. Select the variable(s) representing the COVARIATES (Independent Variables in Model)Identify any CATEGORICAL COVARIATES including Dummy/Indicator variablesK-M PLOTS can be obtained, with separate SURVIVAL curves by categories
Example 9.3 - 6MP vs Placebo