sasakiwi.blogg.se

Spss code example
Spss code example











  1. #Spss code example how to
  2. #Spss code example plus

We can see in this example that the first three subjects were males and the last four subjects were females. You do not need to add text labels – SPSS Statistics will work fine without them – but it can provide extra clarity when analysing your data (especially as text labels are often used in the output instead of the numbers – this helps greatly).

#Spss code example how to

How to do this is explained in our guide on Working with Variables. In this example, we can see that "1" and "2" are replaced by " Male" and " Female", respectively. Because we labelled the numbers using the value attribute we can use the Value Label Button to switch to the text version of the "grouping variable" categories. Looking at the columns on the left we can see that we have created a "grouping variable" called "Gender" that has two categories: " 1" and " 2". By using the value attribute we can label these numbers as representing males and females, respectively. For example, we label "males" as " 1" and "females" as " 2". We do this by labelling our groups numerically. This is a separate column that includes information on which group a subject belongs to. To identify which subjects were males and which were females, you need to create a "grouping variable" in SPSS Statistics. You want to label some of your individuals as female and others as male. A common example is when differentiating between gender. In this sense, you could call the groups "mutually-exclusive". They are groups where the individuals in each group are unique (i.e., no person is in more than one group). Separate groups are more commonly called between-subjects factors or independent groups. The only variation to this is discussed later in this guide when we have to enter repeated measures. To add more variables, simply add more columns - one column per variable. How to label variable columns is in our Working with Variables guide. So, even if we ignored the Subject column, we can see that one individual was 1.55 m tall and weighed 56 kg, looking at the Height and Weight columns, respectively. However, SPSS Statistics does not need you to enter this column, and it is mostly for you to be able to better visualize your data.

spss code example spss code example

The Subject column has been added so that it is clear that each individual is placed on a separate row. Published with written permission from SPSS Statistics, IBM Corporation.

  • Creating dummy variables (e.g., in multiple regression analyses with categorical independent variables).
  • Separate groups and repeated measures (e.g., gender and time course).
  • Multiple separate groups (e.g., gender and level of education).
  • Entering repeated measures (within-subjects factors) (e.g., time course).
  • Defining separate groups (between-subject factors) (e.g., gender, level of education).
  • Entering variables (e.g., height, weight).
  • #Spss code example plus

    We shall now look at the three most common tasks you face when entering data into SPSS Statistics, plus three more advanced setups: Equally, if a row contains more than one person's data, you have also made a mistake. If you find that you have an individual's data on more than one row then you have made a mistake. Therefore, when entering data into SPSS Statistics you must put one person's data on one row only. For the purposes of this explanation, we shall assume that a case is an individual. Usually, a case is an individual, but it can also be a commercial product or a biological cell (or something else entirely).

    spss code example

    A case is the "object" which you are measuring in someway. The principle behind entering data in almost all cases in SPSS Statistics is to enter each unique case on a new row. SPSS Statistics sets out its data in a spreadsheet-like manner.

    spss code example

    To restructure data from long to wide, use theĪlternatively, you can use the Data Restructuring Wizard in SPSS for more, see Restructure data in SPSS.Entering Data in SPSS Statistics The "one person, one row" Rule make CALORIES from CALORIES1 CALORIES2 CALORIES3 make WEIGHT from WEIGHT1 WEIGHT2 WEIGHT3 To restructure data from wide to long, use the The long format uses multiple rows for each observation or participant: ID WEIGHT CALORIES TIME The wide format uses one row for each observation or participant: ID WEIGHT1 WEIGHT2 WEIGHT3 CALORIE1 CALORIE2 CALORIES3 Note that the example data contain two participants measured on two outcome variables (weight and calories), under three different time points. Below are data sets repeatedly measured in wide and long format. SPSS allows you to use Syntax code to reshape data from wide to long format, and vice versa. Restructure data using Syntax commands in SPSS













    Spss code example