Presentation is loading. Please wait.

Presentation is loading. Please wait.

Statistical Computing I: Introduction to SPSS

Similar presentations


Presentation on theme: "Statistical Computing I: Introduction to SPSS"— Presentation transcript:

1 Statistical Computing I: Introduction to SPSS
By: Behailu Department of Statistics Dilla University Dilla, Ethiopia

2 Introduction to SPSS What is SPSS?
Originally it is an acronym of Statistical Package for Social Science. A package of programs for manipulating, analyzing, and presenting data; the package is widely used in the social and behavioral sciences, in Education and Industry. Statistical analyses range from basic descriptive statistics, such as averages and frequencies, to advanced inferential statistic

3 Continued… such as regression models, analysis of variance, and factor analysis. That is the most popular statistical packages which can perform highly complex data manipulation and analysis with simple instructions. SPSS is a comprehensive statistical software package that handles all aspects of data analysis and data management. SPSS allows you to perform many analyses on your PC that were once, possible only on much larger machines.

4 Continued… SPSS – Strengths
SPSS provides a user interface that creates a more intuitive environment for analysis for all levels of users that allow you to perform most tasks simply by pointing and clicking. Ideal for discrete and continuous data types (test subscales) Test data, Likert scale item data Data can be imported in various types ASCII (American Standard Code for Information Interchange), Access (to open or load a computer file, an internet site, etc.) Excel, SAS, SPSS, etc.

5 Continued… Data files stored as system files for later use
Variable names have length restrictions Data files stored as system files for later use Some model syntax can be built through the menus Basic statistics (e.g. means and correlations) are generated in an underlying program SPSS is used to confirm the structural validity of a measurement model for any assessment Requires syntax and input matrices.

6 Continued… SPSS is a powerful and flexible system for statistical and information analysis With SPSS we can … Prepare one, two and higher dimensional Statistical tables. Produce high quality graphs Comparison of means with t-test, Z-test Perform Advanced Statistical Analysis like Multiple Regression, Factor Analysis, Analysis of Variance etc.

7 Continued… Limitations Of Excel Sex 1=Male Sex 2=Female 1 2 S.NO
Advantages of SPSS 1 Data should be numeric and labels cannot be attached to the codes used in the data Data labels can be defined for all the variables so that the output becomes more readable 2 The number of statistical tools is limited and help in simple statistical analysis Advanced statistical tools are available. 3 Many of the analytical tools require the data in separate rows or columns but not as a mixed collection of a records SPSS can automatically pick up cases from data file of mixed records. 4 Multivaraite procedures like stepwise regression , Factor analysis , MANOVA cannot be handled by EXCEL. Multivariate tools like Stepwise regression , generalised linear models, factor analysis and MANOVA can be handled with large sets of data. Sex 1=Male 2=Female Sex 1 2 Sex M F Sex M F

8 SPSS - Weaknesses Ease of doing data manipulation can sometimes lead to mistakes as the program does not preclude inappropriate modifications to the data. Matching feature requires exact match. Duplicate records generate warnings but can be marked in file. Error logs are hard to interpret at times. Incompleteness of menus means some options are only available via syntax.

9 Continued… While the majority of output is saved as pivot tables allowing great flexibility in modifying tables. Output tables and graphs generally not done as well as Excel and are harder to manipulate. How to start and exit SPSS To start SPSS, double-click on the SPSS program icon on your desk top, if you have one, or go to Start, Programs and click on SPSS for Windows.

10 Continued… To close SPSS, you can either left click on the close button located on the upper right hand corner of the screen or select Exit from the File menu. A dialog box like the one below will appear for every open window asking you if you want to save it before exiting. You almost always want to save data files. Output files may be large, so you should ask yourself if you need to save them or if you simply want to print them.

11 SPSS windows The Data Editor window has two views that can be selected from the lower left hand side of the screen. Data View is where you see the data you are using. Variable View is where you can specify the format of your data when you are creating a file or where you can check the format of a pre-existing file. The data in the Data Editor is saved in a file with the extension.

12 Continued…

13 Starting SPSS To start SPSS: From the Windows Start menu choose:
 Programs     SPSS for Windows… A small window will appear. This window has several choices with different questions and options. Run tutorial Type in Data Run an existing query

14 Continued… Create new query using an existing data base
Open an existing data source If you choose type in data, you will get Data Editor Window

15 The menus and their use Exiting SPSS: you can either left click on the close button located on the upper right hand corner of the screen Or select Exit from the File menu (File -> Exit). File Open a new/existing file Open a new file Import data into SPSS from an existing text file, Excel spreadsheet or Database Save the data file Exit SPSS for Windows

16 Continued… EDIT To make changes to the data -Copy, Paste, Insert Variables, Insert Cases etc VIEW Hide or show Status bar or Toolbar Change font or point size of the data Hide or show gridlines Switch between Data View and Variable View

17 The menus and their use DATA: To manipulate existing SPSS data files - Define variables, Sort cases, Merge files, Split files, Select cases, Weight cases etc. TRANSFORM: Perform computations on variables -Create new variables from existing ones. Recode old variables etc. ANALYZE: Contains extensive list of statistical analysis. GRAPHS: To obtain high resolution plots and graphs, which can be edited in Chart Editor window.

18 Continued… UTILITIES: Allows you to list file information which is a list of all variables, there labels, values, locations in the data file, and type. Contains a number of Additional Advanced SPSS Products that can be purchased separately and used in conjunction with the base Product. Ex: SPSS Conjoint, SPSS Tables, SPSS Maps etc. WINDOW: To move to any open window or to see which window is active. The window with a check mark is the active one.

19 Continued… HELP: To get help on topics in SPSS via a Predefined List of Topics, Tutorial, Statistics Coach, Syntax Guide etc. Name:In the first column, enter the Name of the Variable. Each name must be unique It can be up to 64 characters long The name cannot begin with a number of contain spaces Keep names short but descriptive of variable Type: In the second column, click on right of this column

20 Continued… Select the Variable Type The Default is Numeric
If Numeric, select the Width -Number of digits as well as the Number of Decimal Places Label: Label allows you to provide the variable with a longer, more complete description.(a string of text to identify in more detail what a variable represents and limited to 255 characters and may contain spaces and punctuation). Value label: Used for describing the labels of the categories for Nominal or Ordinal (Categorical) Data.

21 Continued… Missing Values: Used to define specific values as being Missing values: non-response, refusal (e.g. 9, 99). Should not be legitimate coded values already included in the data set. Column Width: The value used for column width indicates how wide the display for each variable will be in the Data View. Column widths can also be changed in Data View, by clicking and dragging the column borders.

22 Continued… Alignment: Determines how the data for this variable are aligned in their cells in the Data View Window (the information is left-justified, right-justified, or centered) Measurement Level Specify the variable's measurement level as: Nominal Ordinal Scale (Interval or Ratio): both of these quantitative variable types are lumped together as "scale”

23 Continued… Saving Data In SPSS:
To save an SPSS data file, follow these steps. Click File and click Save as. The “Save Data As” window is appears. Overview of SPSS for Windows SPSS Windows consists of five different windows, each of which is associated with a particular SPSS file type. These are

24 Continued… Data Editor: is the window that is open at start-up and is used to enter and store data in a spreadsheet format. It contains variables in columns and cases in rows . It contains several menu items that are useful for performing various operations on your data. Output Viewer: opens automatically when you execute an analysis or create a graph using dialog box or command syntax to execute a procedure. The Output Viewer contains the results of all statistical analyses and graphical displays of data.

25 Overview of SPSS for Windows
Chart Editor: This window is used to edit charts and plots. It is only displayed after SPSS has been requested to produce a plot. You can use the window to change the colors, select different type fonts or sizes, rotate axes, change the chart type, and the like. Syntax Editor: is a text editor where you compose SPSS commands and submit them to the SPSS processor instead of clicking on the pull-down menus.

26 The Data Editor The Data Editor window displays the contents of the working dataset. It is arranged in a spreadsheet format that contains variables in columns and cases(observations) in rows. There are two sheets in the window. The Data View is the sheet that is visible when you first open the Data Editor and contains the data. The Variable View this second sheet contains information about the variable that is stored with the dataset.

27 Continued… In Variable View, each row is a variable, and each column is an attribute associated with that variable. Variables are used to represent the different types of data that you have compiled. Variables come in many different types, including numbers, strings, currency, and dates. The SPSS variable naming convention requires the following: The variable name should not begin with any special characters such as numerals, comma, inequality symbols etc.

28 Continued… Do not end variable names with an underscore and a period.
Names are not case sensitive. The latest versions of SPSS can accept variable names with length greater than 8 characters. To write your variable name: Open variable view button or Use Ctrl+T. The variable view in the SPSS Data Editor The variable name should be unique. It must start with a letter (A-Z or a-z), the rest can be number and underscore.

29 Space, +,*,/ and –are not allowed.
The Variable Type dialog box allows you to define the type of data for variables. For example, clicking on the box in the cell for the Type column for the variable the following dialog box:

30 Continued… The Missing Values column allows you to define which values of a variable should be treated as missing data. The Label column is used to define labels for variables. The Values column is used to assign labels to the particular values of a variable. The Data view in the SPSS Data Editor The first step for entering the actual data is to click on the Data View tab. To enter new data, click in an empty cell in the first empty row.

31 Continued… Data can be directly entered in SPSS, or a file containing data can be opened in the Data Editor. Data can be entered from the excel. Inserting or Deleting Cases and Variables To delete a variable: In variable view (row), select the row number that you wish to delete, click on Edit, and then on Clear. The selected variable will be deleted. To insert a new variable (row) between existing variables: Click on the row that is below the row where you wish to enter a new variable,

32 Continued… click on edit on the menu bar, and then click on Insert Variable from the pull-down menu. Use either “insert variable” or “insert case” as needed. Deleting Cases: To delete a case, click on the case number that you wish to delete, click on Edit from the menu, and then on Clear.

33 SPSS Program Windows SPSS Program Windows Data Editor Data View
Variable View Output Viewer Syntax Editor File Types Data: filename.sav Output: filename.spo Commands: filename.sps

34 Data View Data Editor Spreadsheet-like system for defining, entering, editing, and displaying data. Extension of the saved file will be “filename.sav”

35 Toggle between data and variable
The Workspace Variables Value labels Cases Toggle between data and variable

36 Data View The default window will have the data editor
There are two sheets in the window: 1. Data view 2. Variable view

37 Data View When SPSS is opened, a blank spreadsheet appears.
We can enter data in the cells of this sheet. In this editor there is no column headings(Variable Names), It is entered in the variable View

38 Data View Variables (Columns) From the menu choose File Open Data
In data file, cases represent individual respondents to a survey. Variables represent responses to each question asked in the survey. Variables (Columns) From the menu choose File Open Data Cases (Rows) In the Data Editor, we put the mouse Cursor on a variable name, a more descriptive variable is displayed The data file is displayed in the Data Editor.

39 Variable View Data should be entered with one variable in one column
It should have a name called field name or variable name By choosing variable view we can see the list of variables and their properties

40 Variable View This sheet contains information about the data set that is stored with the dataset

41 Variable View Rules for Naming the Variables
Special characters like # are not allowed in defining names No two fields should have the same name Names should not have spaces in between Education Level is wrong EDU_LEV is permitted SPSS would pick up duplicate names and assigns a new and unique name like V1, V2 etc.

42 Variable View Select Variable Type

43 Accessing Data from Spreadsheets
Data that has been entered in Excel can be opened in SPSS The SPSS16.0 and latter versions would directly open the Excel file by selecting the File type as Excel

44 Accessing Data from Spreadsheets
From the menu choose File Open Data Click open data document button in the tool bar Select Excel (*.xls) as the file type You want to view

45 Accessing Data from Spreadsheets
Select the check box allowing you to specify whether variable names are to be included in the spread sheet, This option reads column headings as variable names We can also specify which worksheets You want to import We want to import only a portion of the spreadsheet Specify the range of cells to be imported in the range text box Regarding and Editing data, Excel has better features than SPSS

46 Accessing Data from Spreadsheets
Imported From Excel File to SPSS Statistics Data Editor

47 Accessing Data in Relational Database
Data that has been entered in Access can be opened in SPSS

48 Accessing Data in Relational Database
From the menu choose File Open Database New Query Select MS Access Database from the list of data sources and click Next button

49 Accessing Data in Relational Database
Click Browse to navigate to the Access database file that we want to open. Click OK in the login dialog box Drag the entire empty table to the Retrieve Fields in this order list. Click Next to continue

50 Accessing Data in Relational Database
In this step, we select which records to import If we do not want to import all cases, we can import a subset of cases or we can import a random sample of cases from the data source. Click Next to continue

51 Accessing Data in Relational Database
Click the Recode to numeric cell in the string field. This option converts string variables to integer variables and retains the original value as the valued label for the new variable

52 Accessing Data in Relational Database
The SQL statement created from your selections in the Database Wizard appears in the results step All of the data in the Access database that you selected to import are now available in the Data Editor

53 Accessing Data from a Text File
Comma or tab or space delimited files refer to rows of data that use commas or tabs or spaces to indicate each variable Space delimited, between two words in the string variable space is not allowed, give Single or double quote to the string variable

54 Accessing Data from a Text File
From the menu choose File Read Text Data Select Text (*.txt) as the file type You want to view

55 Accessing Data from a Text File
The text file is displayed in a preview window. You can apply a predefined format (previously saved from the Text Wizard) or follow the steps in the Text Wizard to specify how the data should be read And Click Next to continue.

56 Accessing Data from a Text File
Select Yes to indicate that variable names Should be read from the top of the file. Click Next to continue

57 Accessing Data from a Text File
Click Next to continue

58 Accessing Data from a Text File
Click Next to continue

59 Accessing Data from a Text File
select a format from the drop-down list. Select a variable in the preview window which is name in this case

60 Accessing Data from a Text File
Leave the default selections in this dialog box, and click Finish to import the data

61 Imported From Test File to SPSS Statistics Data Editor

62 Importing data from ASCII files
A text or flat file format a file with filename .txt or .dat extension To open an ASCII file, select the following menu options from the menu in the Data Editor window in SPSS.    File =>Open... And then, select the desired location on disk using the Look in option. Next, select Text (*.txt) from the Files of type drop-down menu. In delimited ASCII format the variables for each case must appear in the same order and the values for each variable must be separated by a delimiter.

63 Continued… A delimiter can be a comma, space, tab, semicolon, or some other symbol chosen by the user. To open ASCII file delimited1.dat use the following steps Step 1: Say No Step 2: select Delimited format and select No for the second question Step 3: the case begin from line 1 Step 4: Needs to define the breakpoints for each individual variable Step 5: Enter the variable names and the data format for each variable

64 Continued… Merging Data Files
Select Do Not Import as the data format for the first variable (V1,  the asterisks). Merging Data Files Merge data from two files in two different ways. You can use: We can merge files into two different ways: add variables and add cases Statistics data file containing the same variables but different cases. SPSS Statistics data file containing the same cases but different variables.

65 Continued… To Merge Files From the menus choose: Data =>Merge Files
Add variables: adds new variables on the basis of variables that are common to both files. In this case, we need to have two data files. Each case in the one file corresponds to one case in the other file. In both files each case has an identifier, and the identifiers match across cases.

66 Merging Files(count…)
Example, Given below we have a file containing dads and we have a file containing faminc. Dads fami name Inc 2     Art  1     Bill 3     Paul faminc Famid faminc faminc faminc98 3                                       4/27/2019 5:33:07 PM

67 Continued… To merge the two files the procedure is as follows:
First sort both data sets by famid. Select : Data Merge files … add variables and select the file faminc. Similar procedure we use for merging files (add cases option)

68 Transpose all data We choose this when we want to transpose our data.
All rows will become columns and all columns will become rows in the new data. The procedure is as follows: From the data menu we select restructure From the dialogue box we select “ Transpose all data ” and click finish Transpose dialogue box will appear. We have to select all variables to transpose. (Note un-selected variables will be lost.) Click Ok. The transformed data that change rows to columns and columns to row will appear.

69 Selecting Cases You can analyze a specific subset of your data by selecting only certain cases in which you are interested This can be done by using the Select Cases menu option, which will either temporarily or permanently remove cases you didn't want from the dataset. The Select Cases option (or Alt+D+C) is available under the Data Data then Select Cases... Selecting this menu item will produce the following dialog box.

70 Continued… The portion of the dialog box labeled “Unselected Cases Are” gives us the option of temporarily or permanently removing data from the dataset. If the “Filtered” option is selected, the selected cases will be removed from subsequent analyses until “All Cases” option reset.

71 Continued… If the “Deleted” option is selected, the unselected cases will be removed from the working dataset. If the dataset is subsequently saved, these cases will be permanently deleted. “If condition is satisfied” option and clicking on the If button the results in a second dialog box, will appear as shown below.

72 Continued…

73 Aggregating Files Aggregating files is one way of data manipulation procedure. The Aggregate procedure allows you to condense a dataset by collapsing the data on the basis of one or more variables. To access the dialog boxes for aggregating data, follow the following steps: 1. Select Data and then AGGREGATE 2. We will observe a dialogue box. This dialogue box has several options. These are as follows.

74 Continued… Break variable: The top box, labeled Break Variable(s), contains the variable within which other variables are summarized. This is something like classification variable. Aggregated Variables: contains the variables that will be collapsed. Number of cases: This option allows us to save the number of cases that were collapsed at each level of the break variable. Save: This has three different options. I) Add the aggregated variables to working data file

75 Continued… II) Create new data file containing aggregated variables.
III ) Replace working data with aggregated variables only. We may choose one of the above three options depending on our interest. Options for very large data sets: This has two options : File is already sorted on break variable(s) Sort file before aggregating.

76 Restructure Data We use Restructure data wizard to restructure our data. Suppose, the data that are arranged in groups of related columns. Our interest is to restructure these data into groups of rows in the new data file. Then we choose the option restructure selected variables into cases. The procedure is as follows. From the data menu select restructure, the dialogue box which says “Welcome to the restructure Data wizard” will appear.

77 Continued… Choose the first option “Restructure selected variables into cases” and click next. Another dialogue box which says “Variable to cases : Number of variable groups” will appear. Choose the first option “ One” and click next. Give the name of target variable. Select all variables to variables to be transposed box and Click next. Another dialogue box which says “Variable to cases: Create index variable” will appear. Choose the first option “ One” and click next.

78 Continued… Another new dialogue box will appear here change the variable name “Index” to group. Click finish and see your restructured data. We can also restructure the data from cases to variables Computing New Variables You may want to create new variables in your datasets (modify the values of the variables in your dataset). Such operations can be performed using the Compute option available from the menu in the Data Editor: Transform Compute...

79 Continued… For example, if a dataset contained employees' salaries in terms of their beginning and current salaries, a new variable (say, difference between starting salary and present salary) could be computed by subtracting the starting salary from the present salary.

80 Continued… Variables can also be computed conditionally by using IF tab. For instance, if, in the above example, we are interested to calculate the salary change only for those people who began working for the company within the last five years, we could create a condition that would compute a new variable only if an employee had begun employment within the last five years (60 months). To do this, Click on IF tab and then “compute variable: if cases ” dialog box will appear, which will produce the following dialog box:

81 Continued… Write job time>60 on the right side box
Click CONTINUE to come back the “Compute Variables” Then click OK

82 Recoding Variables You can also modify the values of existing variables in your dataset. The RECODE option allows you to create discrete categories from continuous variables For example, if a dataset contains a variable that classifies an employee's status in three categories, but for a particular analysis you want to combine two of these classifications into a single category, then two of the values would need to be recoded into a single value so that there are only two groups.

83 Continued… there are two options for recoding variables in the Recode submenu those are : Into Same Variables:This option changes the values of the existing variables Into Different Variables: This option changes the values of the existing variables As an example, consider the employment data: We have the following steps. Transform Recode

84 Continued… Select Transform/Recode/Into Different Variables.
A list of variables in the active data set will appear. Select the variable you wish to change by clicking once on the variable name and clicking the arrow button. Click the output box and enter a new variable name ( 8 characters maximum) and click Change. NOTE: In dialog boxes that are used for mathematical or statistical operations, only those variables that you defined as numeric will be displayed. String variables will not be displayed in the variable lists. 4/27/2019 5:33:07 PM

85 Continued… Select old and new values.
This box presents several recoding options. You identify one value or a range of values from the old variable and indicate how these values will be coded in the new variable After identifying one value category or range, enter the value for the new variable in the New Value box. Click ADD and repeat the process until each value of the new variable is properly defined. Recode: Old and new values.

86 Continued…

87 Sorting cases Sorting cases allows you to organize rows of data in ascending or descending order on the basis of one or more variable. For example, data could be sorted by job category so that all of the cases coded as job category 1 appear first in the dataset, followed by all of the cases that are labeled 2 and 3 respectively. The data could also be sorted by more than one variable. For example, within job category, cases could be listed in order of their salary. The Sort Cases option is available under the Data menu item in the Data Editor: Data Sort Cases...

88 Continued… A small dialog box with header Sort Cases will pop up.
Then choose whether the data are sorted in ascending or descending order, select the appropriate button. similarly the data could also be sorted by more than one variable. For example, within job category, cases could be listed in order of their salary. The dialog box that results from selecting Sort Cases presents as follow:

89 Continued…

90 DESCRIPTIVE STATISTICS
CHAPTER TWO DESCRIPTIVE STATISTICS PRESENTATION OF DATA A Viewer window opens the first time you run a procedure that generates output. In this window, you can easily navigate to whichever part of the output you want to see. The Viewer is divided into two panes:

91 Continued… The left pane of the Viewer contains an outline view of the contents (Outline pane), The right pane contains statistical tables, charts, and text output (Contents pane). The icons in the outline pane can have two forms namely:

92 Continued… The open book icon: indicates that it is currently visible in the Viewer The closed book icon: indicates that it is not currently be visible in the viewer.

93 Continued… The four output components: Title, Notes, Statistics, and variable have been obtained with the Frequencies procedure. To hide a table or a chart in the display without deleting it, double-click its book icon in the outline pane. Presentation of Data using Tables Much of the output in SPSS is displayed in a pivot table format. To edit the text in any SPSS output table, you should first double-click that table.

94 Continued… This will outline dashed lines, as shown in the figure below, indicating that it is ready to be edited. Some of the most commonly used editing techniques are the following: Changing column width and editing text Exporting Tables In addition to modifying a table's appearance, you may also wish to export that table. There are three primary ways to export tables in SPSS. To get a menu that contains the available options for exporting tables, right-click on the table you wish to export.

95 Continued… The three options for exporting tables are: Copy, Copy object, and Export. Presentation of Data using Diagrams and Graphs Bar graphs are a common way to graphically display the data that represent the frequency of each level of a variable. To access the SPSS facilities for visually displaying data as a bar graph, select the Bar option from the Graphs menu: GraphsBar...

96 Modifying and Exporting Diagrams & Graphs
The primary tool for modifying charts in SPSS is the Chart Editor. The Chart Editor will open in a new window, displaying a chart from your Output Viewer. The Chart Editor has several tools for changing the appearance of your charts. To open the Chart Editor, double-click on an existing chart and the Chart Editor window will open automatically. The Chart Editor shown below contains a bar graph of employment categories:

97 Summary Statistics A common first step in data analysis is to summarize information about variables in your dataset, such as the averages and variances of variables. Several summary or descriptive statistics are available under the Descriptive option available from the Analyze and Descriptive Statistics menus: Analyze Descriptive Statistics Descriptive... Frequencies While the descriptive statistics procedure described above is useful for summarizing data with an underlying continuous distribution, the Descriptive procedure will not prove helpful for interpreting categorical data.

98 Continued… Cross tabulation
Instead, it is more useful to investigate the numbers of cases that fall into various categories. The Frequencies procedure is found under the Analyze menu: Analyze Descriptive Statistics Frequencies... Cross tabulation While frequencies show the numbers of cases in each level of a categorical variable, they do not give information about the relationship between categorical variables.

99 Continued… The Crosstabs procedure is useful for investigating this type of information because it can provide information about the intersection of two variables. The number of men and women in each of three employment categories is one example of information that can be cross tabulated. The Crosstabs procedure is found in the Analyze menu in the Data Editor window: Analyze  Descriptive Statistics Crosstabs…

100 CHAPTER THREE Customizing SPSS Outputs and Reporting
Editing SPSS outputs Most of the outputs in SPSS are in table and graph forms. So that we will assess table and graph output editing. To edit the text in any SPSS output table, you should first double-click that table. This will outline dashed lines, indicating that it is ready to be edited. Some of the most commonly used editing techniques are changing the width of rows and columns, altering text and moving text.

101 Changing column width and altering text
To change column widths, move the mouse arrow above the lines defining the columns until the arrow changes to a double-headed arrow facing left and right. When you see this new arrows, press down on your left mouse button, then drag the line until the column is the width you want, then release your mouse button. Editing text: first double-click on the cell you wish to edit, then place your cursor on that cell and modify or replace the existing text.

102 Continued… For example, the table was double-clicked to activate it, then the pivot table’s title was double-clicked to activate the title. The original title, “Employment category” was modified by adding the additional text, “as of August 1999.” Using basic editing commands, such as cut, copy, delete, and paste: When you cut and copy rows, columns, or a combination of rows and columns by using the Edit menu’s options.

103 Continued… The cell structure is preserved and these values can easily be pasted into a spreadsheet or table in another application.

104 Continued… Aside from changing the text in a table, you may also wish to change the appearance of the table itself. But first, it is best to have an understanding of the SPSS TableLock concept. A tableLock is a file that contains all of the information about the formatting and appearance of a table, including fonts, the width and height of rows and columns, coloring etc. There are several predefined TableLock that can be viewed

105 Continued… by first right-clicking on an active table, then selecting the TableLocks menu item. Doing so will produce the following dialog box.

106 Continued… The above figure shows the table properties dialog box with the cell formats tab selected. You can alternate between tabs (e.g. General, Footnotes, etc.) by clicking on the tab at the upper left of the dialog box is beyond the scope of this document, there are a few key concepts that are worth mentioning.

107 Continued… Note the Area box at the upper right of the dialog box.
This refers to the portion of the box that is being modified by the options on the left side of the box. For example, the color of the text was changed to white by first choosing data from the area box, then selecting black from the Background drop-down menu and selecting white for the text by clicking on the color palette icon in the Text area on the left side of the dialog box. Any modifications to a specific table can be saved as a tableLock.

108 Continued… By saving a TableLock, you will be saving all of the layout properties of that table and can thus apply that look to other tables in the future. To save a tableLock , click on the General tab in the Table properties dialog box. There are three buttons on the bottom right of this box. Use the save Look button to save a TableLook. That button will produce a standard save as dialog box with which you can save the TableLook you created.

109 Exporting Tables in SPSS
In addition to modifying a table’s appearance, you may also wish to export that table. There are three primary ways to export tables in SPSS. To get a menu that contains the available options for exporting tables, right-click on the table you wish to export. The three options for exporting tables are: Copy Copy object Export The copy option copies the text and preserves the rows and columns of your table but does not copy formatting, such as colors and borders.

110 Continued… This is a good option if you want to modify the table in another application. When you select this option, the table will be copied into your system clipboard. To paste the table, select the paste command from the Edit menu in the application to which you are importing the table. The copy option is useful if you plan to format your table in the new application. The disadvantage of this method is that you will lose much of the formatting that you observe in the output viewer.

111 Continued… The disadvantage of this method is that it can be more difficult to change the appearance of the table once it has been imported. The third method, Export, allows you to save the table as an HTML or an ASCII file. The result is similar to the copy command. This method for exporting tables to other applications is different from the above two methods in that it creates a file containing the table rather than placing a copy in the system clipboard.

112 Continued… The primary advantage of this method is that you can immediately create an HTML file that can be viewed in a web browser. Modifying and Exporting Graphs The primary tool for modifying charts in SPSS is the Chart Editor. The chart Editor will open in a new window, displaying a chart from your Output Viewer. The chart editor has several tools for changing the

113 Continued… Appearance of your charts or even the type of chart that you are using. To open the Chart Editor, double-click on an existing chart and the Chart Editor window will open automatically. The Chart Editor shown below contains a bar graph of employment categories.

114 CHAPTER FOUR INTRODUCTION TO MINITAB
Objectives are: Enter data in Minitab. Open and save both Projects and Worksheets. Use Minitab’s pull down menus and the submenus. Calculate with columns of data. Use Minitab to calculate descriptive statistics. Draw histograms, box plots, and scatter plots. How to start MINITAB? Click the Start button in the bottom left hand corner of the screen. Select Programs > Minitab for Windows > Minitab Minitab will open

115 Minitab Widows When you first open Minitab, you will see two windows, a Session window and a Worksheet window. Session Window: The area that displays the statistical results of your data analysis. Worksheet Window: A grid of rows and columns used to enter and manipulate the data. Note: This area looks like a spreadsheet, but will not automatically update the columns when entries are changed.

116 Continued… Graph Window: When you generate graphs, each graph is opened in its own window. History and Project Manager are other windows. Numerical: Numerical data is the only type of data that Minitab will use for statistical calculations. Numerical data is aligned on the right side of the column. Minitab will not recognize numbers with commas as numbers, but as text. Text: Text cannot be used for computations.

117 Continued…. Date/Time:
Minitab recognizes 3/5/00 as a date, but will store this internally as a number so you can manipulate it. The column label will indicate a date by C1-D and a time by C1-T. You can enter your data going down or across. In the top left corner of the Worksheet window, there is a cell with an arrow in it. Click this cell to change the action of the Enter key. If the arrow is pointing down, then when you press Enter, the cursor will go down the column.

118 Entering and saving Minitab data

119 Continued…. Entering data is really two steps:
Entering the column headings and then entering the data itself. Enter the column headings. Column headings must be entered above Row 1 Enter “Temperature (F)” in the first cell in Column 1. *The first cell is above Row 1. Enter “Water Consumption (ounces)” in first cell in Column 2. *The first cell is above Row Enter the data: Enter the corresponding temperatures and water consumption in the appropriate column as shown. Do not change the order of the items. Make sure the items were entered as numbers not tex.

120 Continued…

121 Continued… Saving Minitab data: Two different things in Minitab:
You can save the worksheet by itself, or the entire project. Saving the worksheet as a separate file is a very good habit. That way you have the data stored in a place where you can always go back to it, even if the data you are working within a given project is corrupted. To save the data in a worksheet by itself, Select

122 Continued… FILE > SAVE CURRENT WORKSHEET AS.
Use the arrow beside the Save in field to select the Floppy (A) or location of your diskette. In the File Name field type the name of the worksheet. Minitab will automatically add the extension MTW for Minitab worksheet. Click Save Minitab will conduct a variety of statistical calculations. These are found under the main menu option of STAT. A menu of the statistics categories is shown below. Each category also has subcategories.

123 Continued….

124 Continued…

125 Chapter Five Descriptive Statistics using Minitab
Basic Statistics Use Minitab's basic statistics capabilities for calculating basic statistics and for simple estimation and hypothesis testing with one or two samples. The basic statistics capabilities include procedures for: Calculating or storing descriptive statistics Hypothesis tests and confidence intervals of the mean or difference in means Hypothesis tests and confidence intervals for a proportion or the difference in proportions Hypothesis test for equality of variance Measuring association Testing for normality of a distribution

126 Calculating and storing descriptive statistics
Display Descriptive Statistics produces descriptive statistics for each column or subset within a column. You can display the statistics in the Session window and/or display them in a graph. Store Descriptive Statistics: stores descriptive statistics for each column or subset within a column. Thus, the outcome is saved as a worksheet by column for each variable To store descriptive statistics, Choose Stat > Basic Statistics > Store Descriptive Statistics. In Variables, enter the columns containing the data you want to store. If you like, any dialog box options, then click OK. Graphical Summary produces four graphs and an output table in one graph window.

127 Continued… To calculate descriptive statistics individually and store them as constants, see Column Statistics. For the temperature/water data, find the mean and standard deviation. You should have the temperature in column C1 and the water consumption in column C2. For this exercise, we will ignore the values in C3. Select Stat > Basic statistics> Display> Descriptive statistics In the Variables box, select C1 (Temperature) Click OK. Look in the Session window. You should see the following display

128 Continued…

129 Continued… Terms in the output and some definitions:
N = number of data items in the sample N* = number of items in the sample that are missing data (N* does not show up when all the items in the sample have data, as in our example.) Mean = "average" Median = "middle number" TrMean= the 5% Trimmed Mean StDev = standard deviation SE Mean = standard error of the mean = standard deviation divided by the square root of the sample size

130 Continued… Minimum = smallest data value Maximum = largest data value
Q1 = 25th percentile = first quartile Q3 = 75th percentile = third quartile Example of Displaying Descriptive Statistics You want to compare the height (in inches) of male (Sex=1) and female (Sex=2) students who participated in the pulse

131 Continued… study. You choose to display a box plot of the data.
Open the worksheet PULSE.MTW. Choose Stat > Basic Statistics > Display Descriptive Statistics. In Variables, enter Height. In By variable, enter Sex. Click Graphs and check Box plot of data. Click OK in each dialog box.

132 Continued…

133 Continued… Display Descriptive Statistics − Graphs Stat > Basic Statistics > Display Descriptive Statistics > Graphs Displays a histogram, a histogram with a normal curve, an individual value plot, and a box plot. Dialog box items Histogram of data: Choose to display a histogram for each variable. Histogram of data, with normal curve: Choose to display a histogram with a normal curve for each variable. Individual value plot: Choose to display an individual value plot for each variable. Box plot of data: Choose to display a box plot for each variable.

134 Graphical Summary To make a graphical summary
Choose Stat > Basic Statistics > Graphical Summary. In Variables, enter the columns you want to describe. If you like, use any dialog box options, then click OK. Dialog box items Variables: Enter the columns for which you want to create a graphical summary. Confidence level: Enter a value for the confidence level for the confidence intervals. The default level is 95%.

135 Continued… Specify any number between 0 and 100. For example, entering 90 generates 90% confidence intervals for the mean, median, and standard deviation. The graphical summary includes a table of descriptive statistics, a histogram with normal curve, a box plot, a confidence interval for the population mean, and a confidence interval for the population median. Minitab can display a maximum of 100 graphs at a time. Open the worksheet PULSE.MTW. Choose Stat > Basic Statistics > Graphical Summary. In Variables, enter Pulse1. Click OK.

136 Continued…

137 Continued… Interpreting the results
The mean of the students' resting pulse is (95% confidence intervals of and ). The standard deviation is (95% confidence intervals of and ). Using a significance level of 0.05, the Anderson-Darling Normality Test (A-Squared = 0.98, P-Value = 0.013) indicates that the resting pulse data do not follow a normal distribution.

138 Chapter Six Customizing Minitab Outputs and Reporting
Editing Minitab outputs Click on the session window (to make it the ‘default’ window), and select Editor ►output editable. You can now use the session window like a word processor, although the facilities are limited. Editing Graphs Instead of re-doing a graph if you forgot to, say, put a title on one of the axes, you can edit it instead.

139 Continued… Also you may want to add something to a graph that was not possible when using commands. With the graph window active, pull down Editor ►Edit (or double click on a graph or simply click on the button on the Toolbar). This puts you in editing mode, and makes the ‘tool palette’ and ‘attribute palette’ appear on the screen. If you click on one of the buttons in the attribute or tool palette, it will have a lighter color than the rest and look as though it has been ‘pushed down’. When you click on a button in the tool menu, it enables you to use that particular tool. If you click on a button in the attribute palette, it is like clicking a button in a dialogue box-it executes a command.

140 Continued… For example, the color or size of an object might be changed. Edit ►Select All will select all objects on the graph (provided you have the graph window active and are in ‘editor’ mode). The default tool for ‘editor’ mode is the selection tool. Cutting, Pasting… Copying, Duplicating … The usual Copy, Cut and Paste commands from the Edit menu can be used on objects and text in a graph window. There is also the Edit ►Duplicate command. This is a shortcut for using Copy and Paste. Edit ►Duplicate copies the object or text, and pastes it into the graph next to the original.

141 Continued… Copying and pasting output from MINITAB into a word-processors. This section shows how output from MINITAB’s session, Graph and from Program Manager windows could be copied and pasted into Microsoft Word. First, load MINITAB and retrieve a worksheet or project (say, ‘plus1. mpj’). Also open Word, say from your windowsNT start menu, in the usual manner. You should now see tabs such as MINITAB-PLUSE1.MPJ and Microsoft Word-Doc… at the bottom of your Windows NT screen.

142 Copying and pasting MINITAB text output from session window
Get back into MINITAB (in the usual manner, click on the MINITAB-PULSE.MPJ tab at the bottom of the Windows screen. Highlight/mark the required output in the Session window. ‘Copy’ it (i.e. choose Edit ► Copy) Get back to WORD (click on the Microsoft Word-Doc… tab at the bottom of your windows screen), and position you cursor where you wish to insert the MINTAB output.

143 Continued… And ‘paste’ it (i.e. choose Edit ►Paste).
In WORD, use a font such as ‘Courier New’ with font size 10 to get good representation of MINITAB text output). Copying and pasting MINTAB high-resolution graph from Graph window Choose the required Graph window Next , choose Edit ► Copy Graph Now, switch to WORD (as before). Use the command Edit ► Paste Special to ‘paste’ the graph into the word document.

144 Producing a Report from a MINITAB Output
There are many different ways to produce a report using MINITAB project (output). To get an idea of how to include MINITAB output in a report. starting Microsoft Word: Start > Programs > Microsoft Word In Microsoft Word, write your report. Fore example, type the heading and introductory material describing the research problem you want to investigate.

145 Continued… Statistical analysis results. Suppose you would like to include descriptive statistics and a graph in your report. You first need to run MINITAB and perform the appropriate statistical analysis. You might need a diskette on which to save your work. You may find that the MINITAB’s output is no longer well-lined up after its pasting in Microsoft Word. If that is the case, highlight the output (you just pasted) using your left mouse button and then change the font.

146 Continued… Next, suppose that you would like to insert a scatter plot of variable volume against variable height in your report. Go back to MINITAB program and make the scatter plot. To copy your graph in your word document, proceed as follows. First, right click on your graph, then choose Edit > Copy graph Open your Microsoft word file, position the cursor where you want to paste your scatter plot

147 Continued… Choose Edit > Paste
Continue to type your report and one you are done, save your Word document file and exit Microsoft Word. Note that MINITAB output and graphs can be pasted similarly into other Microsoft software files such as PowerPoint.


Download ppt "Statistical Computing I: Introduction to SPSS"

Similar presentations


Ads by Google