Professional Documents
Culture Documents
Pr. 12 Regression
Pr. 12 Regression
Pr. 12 Regression
Tribhuvan University
Level: BSc.CSIT (3 Sem) Amrit Campus
Roll no: 06 Statistics-II Date: 2081/01/08
Sec: B Practical Number: 12
A B C D E F G H I J K L M N
1
2 Q no. 12) A researcher wanted to examine how the lifetime of a personal computer which is used by children is affected by
3 the time (in hours) spends by the children per day to play games and the available random-access memory
4 (RAM) measured in megabytes (MB) of a used computer. The data is provided in the following table.
Lifetime
5 5 1 7 2 3 4 6
(years)
Play
time
6 2 8 1 5 6 3 2
(hours
/day)
RAM
7 8 2 6 3 2 4 7
(in GB)
8
9 i) Fit the multiple regression model.
10 ii) Predict the lifetime of a computer which have play time 4 hours per day and RAM is 5 GB.
11 iii) How much variation in life time of computer is explained by Play time and RAM?
12 iv) Compute standard error of the estimate.
13 v) Test the significance of regression coefficients and overall fit of the regression equation.
14 vi) Conduct the residual analysis.
15
16 Working expression:
17 The multiple linear regression equation of Y on X1 and X2 is ;
18 Y = b0 + b1X1 + b2X2
19 where, Y = Dependent variable ( Lifetime )
20 X1 = Play time
21 X2 = RAM
22 b0 = sample Y- intercept
23 b1 = sample regression coeff. of Y on X1 kepping X2 as constant
24 b2 = sample regression coeff. of Y on X2 keeping X1 as constant
25 Standard error of estimate (Se) is given as :
26 𝑆𝑒=√(𝑆𝑆𝐸/(𝑛−𝑘−1))
27
28
29
30 Calculation:
31 1) Using SPSS:
32
33 SPSS Syntax:
34 REGRESSION
35 /DESCRIPTIVES MEAN STDDEV CORR SIG N
36 /MISSING LISTWISE
37 /STATISTICS COEFF OUTS CI(95) R ANOVA CHANGE ZPP
38 /CRITERIA=PIN(.05) POUT(.10)
39 /NOORIGIN
40 /DEPENDENT Lifetime
41 /METHOD=ENTER Playtime RAM
42 /PARTIALPLOT ALL
43 /SCATTERPLOT=(*ZRESID ,*ZPRED)
44 /RESIDUALS NORMPROB(ZRESID).
45
46 SPSS Output :
47
48 Descriptive Statistics
49
Mean Std. Deviation N
Lifetime 4.00 2.160 7
50 (years)
Play time 3.86 2.545 7
(hours
51 /day)
Kritisha Shrestha 1 of 1
rd
Tribhuvan University
Level: BSc.CSIT (3 Sem) Amrit Campus
Roll no: 06 Statistics-II Date: 2081/01/08
Sec: B Practical Number: 12
A B C D E F G H I J K L M N
56
Variables Variables
Model Entered Removed Method
1 RAM (in GB), Enter
Play
57 time(hours/
day)b
Kritisha Shrestha 2 of 2
rd
Tribhuvan University
Level: BSc.CSIT (3 Sem) Amrit Campus
Roll no: 06 Statistics-II Date: 2081/01/08
Sec: B Practical Number: 12
𝐹=𝑀𝑆𝑅/𝑀𝑆𝐸
A B C D E F G H I J K L M N
110 where, MSR = mean sum of square due to regression
111 MSE = mean sum of square due to error
112
113 Level of significance:
114 Let α be the level of significance. Generally fix α = 0.05 unless we are given.
115 α= 0.05
116 Decision:
117 Critical value approach : Reject H0 at α level of significance if F > Ftabulated, accept otherwise.
118 p-value approach: If p-value < α, it is significant, otherwise insignificant .
119
120 Critical value:
121 At α=0.05 level of significance and, k=2 and n-k-1 =4, the critical value is,
122 Ftabulated= Fα(k,n-k-1) = 6.944
123
124 ANOVA Table:
125 ANOVAa
126 Sum of
Model Squares df Mean Square F Sig.
127 1 Regression 24.734 2 12.367 15.1439 0.014
128 Residual 3.266 4 0.817
129 Total 28.000 6
130 a. Dependent Variable: Lifetime(years)
131 b. Predictors: (Constant), RAM (in GB), Play time(hours/day)
132
133 Table 1: Hypothesis Testing
134 Cases Symbol Value
Kritisha Shrestha 3 of 3
rd
Tribhuvan University
Level: BSc.CSIT (3 Sem) Amrit Campus
Roll no: 06 Statistics-II Date: 2081/01/08
Sec: B Practical Number: 12
A B C D E F G H I J K L M N
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
Kritisha Shrestha 4 of 4