Spss 202 linear and logistic regression using spss workshop
Download
1 / 50

SPSS 202: Linear and Logistic Regression Using SPSS Workshop - PowerPoint PPT Presentation


  • 730 Views
  • Uploaded on

SPSS 202: Linear and Logistic Regression Using SPSS (Workshop) . Dr. Daisy Dai Department of Medical Research. Contents. Correlation (Pearson, Spearman, r-square) Scatter Plot and Trending Simple regression Multiple regression Logistic regression . Introduction to SPSS. What is SPSS?.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'SPSS 202: Linear and Logistic Regression Using SPSS Workshop' - eavan


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Spss 202 linear and logistic regression using spss workshop l.jpg

SPSS 202: Linear and Logistic Regression Using SPSS (Workshop)

Dr. Daisy Dai

Department of Medical Research


Contents l.jpg
Contents (Workshop)

  • Correlation (Pearson, Spearman, r-square)

  • Scatter Plot and Trending

  • Simple regression

  • Multiple regression

  • Logistic regression



What is spss l.jpg
What is SPSS? (Workshop)

  • Statistical software.

  • CMH has 10 server licenses.

  • SPSS 18.


Spss data entry l.jpg
SPSS Data Entry (Workshop)

  • SPSS data can be entered manually.

    • The format is ready for analysis.

  • SAS, Excel, txt, etc. data can be easily imported to SPSS.

  • SPSS data files are saved as “SPSS data document (.sav)”.

  • SPSS output files are saved as “SPSS viewer document (.spv)”.


Spss data entry6 l.jpg
SPSS Data Entry (Workshop)

  • SPSS has a few unique features in data entry.

    • Categorical variables need to be coded. For instance, code male as 1 and female as 0 or vice versa.

    • When you have two treatments, test and control, please use 1 for test and 0 for control.

    • Categorical variables that are not coded in other sourced data files will not be imported or analyzed properly in SPSS.

    • Continuous variables don’t need coding.

    • Missing values needs to be defined in “variable view” page.


Log in spss l.jpg
Log in SPSS (Workshop)

  • CMH offers server version SPSS 18. Any employee can log in SPSS from your employee account.

  • Go to Start

    ->Program

    ->Accessories

    -> Remote Desktop Connection


Log in spss8 l.jpg
Log in SPSS (Workshop)

  • In the prompted connection window, enter cmhterm.

  • ClickConnect.


Log in spss9 l.jpg
Log in SPSS (Workshop)

  • In the Log On Window, enter your cmh user name and password.

  • Choose log on to CMH

  • ClickOK.


Scatter plot l.jpg

Scatter Plot (Workshop)


Data set 1 anemia in women l.jpg
Data Set 1: Anemia in Women (Workshop)

  • A survey was conduct to a sample of 20 anemia women, randomly selected from a pre-defined geographical area. The participants had a blood sample taken and their hemoglobin (Hb) level and packed cell volume (PCV) measured. They were also asked their age, and whether or not they had experienced the menopause.

  • The goals of the study were to determine whether Hb affects PCV or the other way around or whether Hb was associated with age.


Slide12 l.jpg
Data (Workshop)


Tasks l.jpg
Tasks (Workshop)

  • Import data

  • View and modify data

  • Scatter plot and trending

  • Save the results.


Task 1 import data l.jpg
Task 1: Import Data (Workshop)

  • Double click spss 18 icon on the screen.

  • Click File

    -> Open

    -> Data.

  • Click OK.


Task 1 import anemia data l.jpg
Task 1: Import Anemia Data (Workshop)

  • Select the folder where data saved. (Note: since SPSS is in the server, we need to save files in the net work drive. I usually save files to my account in U drive. )

  • Enter file name.

  • Select file type. (SPSS data file is in .sav format. SPSS can open excel or many other files, please make sure you choose the right file type).

  • Click Open.


Task 2 view and modify data l.jpg
Task 2: View and Modify Data (Workshop)

  • Now the data is open.

  • There are two tabs on the screen, data view tab and variable view tab.

  • We can read the data in “data View” tab.


Task 2 view and modify data17 l.jpg
Task 2: View and Modify Data (Workshop)

  • We can define data structure including variable name, label, etc. in “Variable View” tab.

  • Note the categorical variable, menopause, needs to be coded in the values column. Enter 0 for No and 1 for Yes.


Task 3 scatter plot l.jpg
Task 3: Scatter Plot (Workshop)

  • Generate scatter plot between Hb and PCV.

  • Please list the dependent (outcome) variable in y-axis and the independent (explanatory) variable in x-axis.


Task 3 scatter plot19 l.jpg
Task 3: Scatter Plot (Workshop)

  • Click Graphs

    -> Legacy Dialogs

    -> Scatter/Dot

    -> Simple Scatter

    -> Define


Task 3 scatter plot20 l.jpg
Task 3: Scatter Plot (Workshop)

  • All variables in the Anemia data set is listed in the left panel

  • Select the variables for y axis and x-axis by first clicking the variable in the left panel and then clicking the arrow and the corresponding spot in the right panel.

  • The marker variable is optional. If you want to label the subjects, then choose the corresponding variable as the marker. For instance, you can label the subjects by ID or by menopause. Here we choose menopause.

  • Click OK.


Task 3 scatter plot21 l.jpg
Task 3: Scatter Plot (Workshop)

  • One can double click the figure to prompt Chart Editor.

  • Click on the fitted line icon located in the middle of last line of tool bar.

  • We can also edit font or add in text box.

  • Close Chart Editor.


Task 3 scatter plot22 l.jpg
Task 3: Scatter Plot (Workshop)

  • One can fit linear, quadratic or cubic trend along with confidence interval to the data.

  • Loess (local regression) is an useful tool to fit non-linear and irregular data.


Task 4 save output l.jpg
Task 4: Save output (Workshop)

  • One can save SPSS output file by clicking file -> save as to generate a viewer file in. apv format. This file can be edited by SPSS in the future.

  • Or one can export the figure by right click and export to a word or pdf document. This file is permanent without revision to figures.


Practice l.jpg
Practice (Workshop)

  • Generate scatter plot between Hb and age.

  • Fit an appropriate trend.

  • Use Chart Editor to edit the font and add text when needed.

  • Save the figure.

  • Interpret the scatter plot and r-square.


Correlation l.jpg

Correlation (Workshop)


Tasks26 l.jpg
Tasks (Workshop)

  • Continue with anemia data.

  • Determine Pearson and Spearman correlation among the continuous variables

  • Interpret results


Correlation27 l.jpg
Correlation (Workshop)

  • On the data page, click Analyze-> Correlat-> Bivariate


Correlation28 l.jpg
Correlation (Workshop)

  • We have three continuous variables in the data sets: Hb, PCV and Age.

  • Select these three variables and check Pearson (parametric) and Spearman (non-parametric).

  • Check two-tailed for conservative analysis

  • And flag significant correlations.

  • Click OK.


Pearson and spearman correlation l.jpg
Pearson and Spearman Correlation (Workshop)

Nonparametric correlations are based on ranks of data and it can be applied when data does not follow normality assumption (skewed) or outlier exists.


Simple regression l.jpg

Simple Regression (Workshop)


Tasks31 l.jpg
Tasks (Workshop)

  • Continue using anemia data.

  • Perform simple linear regression.

  • Determine the fitted regression model.


Simple regression32 l.jpg
Simple Regression (Workshop)

  • Click Analyze-> Regression -> Linear


Regression l.jpg
Regression (Workshop)

  • Select Hb as Dependent variable (y axis).

  • Select PCV as Independent variable (x axis).

  • In this case, PCV is the explanatory variable and Hb is the outcome variable. In other words, we investigate how PCV will impact Hb.

  • Click Ok.


Slide34 l.jpg

Hb=5.589+0.205*PCV (Workshop)

When PCV=35, the predicted Hb=5.589+0.205*35=12.8

PCV is significantly associated with Hb with p-value=0.001



Tasks36 l.jpg
Tasks (Workshop)

  • Continue with anemia data.

  • Consider PCV and age as two risk factors associated with Hb.


Multiple regression37 l.jpg
Multiple Regression (Workshop)

  • Click Analyze-> Regression -> Linear


Multiple regression38 l.jpg
Multiple Regression (Workshop)

  • Select Hb as Dependent variable.

  • Select PCV and age as Independent variable.

  • Click Ok.


Multiple regression39 l.jpg
Multiple Regression (Workshop)

  • One can choose more functions in the statistics tab.

  • Click Continue


Slide41 l.jpg

Hb=5.239+0.097*PCV+0.11*age (Workshop)

When PCV=35 and age=20, the predicted Hb=5.239+0.097*35+0.11*20=10.8

The observed Hb is 11.1.

PCV is significantly associated with Hb with p-value=0.008 after taking age into account.



Case study 2 relapse rate in aml l.jpg
Case Study 2: Relapse Rate in AML (Workshop)

One hundred and two patients with acute myelogenous leukemia (AML) in remission were enrolled in a study of a new antisense oligonucleotide (asODN). The patients were randomly assigned to receive a 10-day infusion of asODN or no treatment (Control), and the effects were followed for 90 days. The time of remission from diagnosis or prior relapse (X, in months) at study enrollment was considered an important covariate in predicating response. The response data are shown in next page with Y=1 indicating relapse, death, or major intervention, such as bone marrow transplant before Day 90. Is there any evidence that administration of asODN is associated with a decreased relapse rate?


Slide44 l.jpg

p. 323 (Workshop)


Task logistic regression l.jpg
Task: Logistic Regression (Workshop)

  • Click Analyze->Regression -> Binary Logistic


Task logistic regression46 l.jpg
Task: Logistic Regression (Workshop)

  • Select Relapse as dependent variable.

  • Select time and treatment as covariate.

  • One can also add in time by treatment interaction.

  • Since treatment is binary, click categorical tab and select treatment as categorical covariates.


Questions l.jpg
Questions? (Workshop)


Thank you l.jpg
Thank You (Workshop)

For more information, visit my website

http://www.childrensmercy.org/content/view.aspx?id=9740

Or go to Scope ->Research -> Medical Research -> Statistics


References l.jpg
References (Workshop)

  • Medical Statistics by Campbell et al.

  • Introductory Statistics by Neil Weiss

  • Common Statistical Methods for Clinical Research by Walker


ad