11.2 - Example
11.2 - ExampleWe will refer to the Exam Data set, (Exam.MTW or Exam.XLS), that consists of random sample of 50 students from a previous introduction to statistics course. We will use the variable Final as the response, and include the variables, Quiz Average, Midterm, and Gender as the predictors.
Since Gender is recorded as text, we need to first code Gender into a dummy variable.
To recode a text variable to a dummy variable in Minitab:
- Import data into Minitab
- Data > Code > Text to NumericGo to Transform > Recode Into Different Variables
- Enter Gender into the text box for Code Data From Columns
- Type the word DummyGender into the text box for Store Coded Data In Columns
- In the first text box under Original Values type in Female and in the first text box under New type the number 0
- In the second text box under Original Values type in Male and in the second text box under New type the number 1
- Click OK
To recode a text variable to a dummy variable in SPSS:
- Import data into SPSS
- Since the variable Gender has text responses (i.e. Male, Female) we need to recode this variable into a numeric. We will use 1 to represent Male and 0 for Female.
- Go to Transform > Recode Into Different Variables
- Enter Gender into the Output Variable Window
- In the text box under Output Variable labeled Name: enter DummyGender
- Click Change
- Click the button Old and New Values
- Under Old Value click Value and type in Male
- Under New Value enter in the Value text box the value 1
- Under Old ? New click Add
- Repeat steps 8 through 11 typing in Female and 0
- Click Continue
- Click OK (you should now have a new column of ones and zeroes titled Male)
NOTE: Software is case sensitive. This means that you have to enter the text variable exactly as it appears in the worksheet. Here, for example, Female uses a capital F. If you used lower case for female the DummyGender would include missing data (i.e. an *) for where Gender was Female. Also, notice that DummyGender is entered as one word and not two words.
With the data set open, do the following:
- From the menu bar select Stat > Regression > Regression
- With the cursor in the Response box double click on Final from the list of variables. After making this selection the cursor should automatically move to the Predictors window
- With the cursor in the Predictors window double click on Quiz Average, Midterm, and DummyGender. This should move these variables into the Predictors window.
- Click OK
The output is as follows:
Regression Analysis
The regression equation is
Final = 12.6 + 0.731 Quiz Average + 0.024 Midterm − 1.26 DummyGender
Predictor |
Coef
|
StDev
|
T
|
P
|
Constant |
12.64
|
15.26
|
0.83
|
0.412
|
Quiz Average |
0.7307
|
01653
|
4.42
|
0.000
|
Midterm |
0.0237
|
0.1934
|
0.12
|
0.903
|
DummyGender |
−1.259
|
2.487
|
−0.44
|
0.661
|
S = 9.89832 | R−Sq = 37.3% | R−Sq(adj) = 33.2% |
Analysis of Variance
Source |
DF
|
SS
|
MS
|
F
|
P
|
Regression |
3
|
2683.79
|
849.60
|
9.13
|
0.000
|
Residual Error |
46
|
4506.93
|
97.98
|
|
|
Total |
49
|
7190.72
|
|
|
|
To perform a multiple linear regression analysis in SPSS:
- Open SPSS without data
- Click Analyze > Regression > Linear
- Click the variable Final and move to the text box for Dependent
- Click the variables Quiz_Average, Midterm, DummyGender and move to the text window for Independent(s)
- Click OK
The output is as follows: