Group Assignment Final PDF
Group Assignment Final PDF
The following data refers to the price of a good Y ‘Py’ and the quantity of the good Ysupplied,
‘Sy’.
Py
7 12 10 6 9 13 7 13
Sy 20 46 37 14 33 48 22 45
̅ 1 𝑛 265
Sy = ∑ Sy 𝑖 = 33.125
𝑛 𝑖=1 8
𝑛
SSXX = ∑𝑖=1(Xi −X2) = ∑𝑛𝑖=1 X𝑖 2 – nX2
SSXX = 797-(8*(9.625)2 = 797-741.125 = 55.875
𝑛
SSYY =∑𝑖=1(Yi −Y)2 = ∑𝑛𝑖=1 Y𝑖2 – nY2
SSYY = 9983- (8*(33.125)2)=9983-8878.125= 1204.875
𝑛
SSXY =∑𝑖=1(Xi −X)2(Yi-Y)2 = ∑𝑛𝑖=1 XiY𝑖 – nXY
SSXY = 2806 – (8*9.625*33.125) = 2806 – 2550.625 = 255.375
Therefore, based on the above calculations, the regression coefficients (the slope 𝑚, and the y- intercept
𝑛) are obtained as follows:
𝑆𝑆𝑋𝑌 255.375
m= = = 4.57
𝑆𝑆𝑋𝑋 55.875
∑𝑛𝑖=1(Yi−Y^)2 37.69145
and 𝛿 2 = = = 6.282 Y^= −10.86 + 4.57 Xi in each X values
𝑛−𝑘 8−2
k = no of Variables which is 2 in the above eqn.
797∗6.282 6.282
𝑉𝑎𝑟 (α^) = = 89.60 𝑉𝑎𝑟 (α^)= 55.875 = 0.112
55.875
S.E (α ^) = √𝑉𝑎𝑟 (α^)= √89.06 = 9.466 S.E (β ^) = √𝑉𝑎𝑟 (β^) = √0.112= 0.3347
c) Test the hypothesis that price product influences supply in market
To Test the hypothesis, we need to fulfill the following steps
Step 1:- Put null hypothesis and Alternative hypothesis
Ho = β = 0 > Null hypothesis
H1 = β = 0 > Alternative hypothesis
Step 2 :- Find SE(β)
From the above question we can find that SE(β) = 0.3347
Step 3 :- Now find the half of β
1/2 β = 0.5*4.57=2.285
Step 4:- Compare the standard errors with the numerical values of β half
SE(β)=0.3347 and 1/2 β=2.285
SE(β)<1/2 β
So accept the alternative hypothesis and reject the null which means that β have a significant
role
Note that for a random variable, its variance is the expected value of the squared deviation from the
mean. That is, for a random variable U, with mean Ui its variance is:
Var(U) = E(U-E(Ui))2
∑𝑛𝑖=1 Ui
E(Ui) = and ∑𝑛𝑖=1 Ui = 0
𝑛
0
E(Ui) = = 0
𝑛
Var(U) = E(U2) = 2 and U=(0, 2 )
NB For the simple linear regression model, the errors have mean 0, and variance 2 .
This means that for the actual observed values Yi , their mean and variance are as follows:
Yi= βo + β1Xi+Ui
E(Yi) = E(βo) + E(β1Xi) + E (Ui)
E(Yi) = βo + β1Xi
Var(Y) = E(Y- E(Y))2
VarY = E(βo + β1Xi+Ui - βo + β1Xi)2
VarY = E(Ui)2 = 2
^
First, we replace the unknown mean 0 1 X i with its fitted value Y i b0 b1 X i ,
then we take the “average” squared distance from the observed values to their fitted values.
We divide the sum of squared errors by n-2 to obtain an unbiased estimate of 2
n n
e
^
(Yi Y i ) 2 i
2
i 1 i 1
2 = s2
n 2 n 2
Common notation is to label the numerator as the error sum of squares (SSE).
n n
(Y Y e
^
SSE i i ) 2
2
i
i 1 i 1
Also, the estimated variance is referred to as the error (or residual) mean square (MSE).
SSE
MSE s2
n 2
3. Researcher is using data for a sample of 100 households to estimate the relation between daily
consumption expenditure and income in dire dawa city Sabina kebele. Preliminary analysisof the
sample data produces the following data.
∑ 𝑥𝑦 = 7000
∑ 𝑥2 = 10000
∑ 𝑦2 = 20000
∑ X = 1000
𝑌̅ = 20
n = 100
𝑋̅ = 10
a) Use the above information to compute OLS estimates of the intercept and slope coefficients
and interpret the result.
For the regression line: Yˆ = β0ˆ + β1ˆ X ˆ
Where:
β1ˆ = ∑ 𝑥𝑦
∑ 𝑥2
β1ˆ 7,000
=
10,000
β1ˆ = 𝟎. 70
β0ˆ = 𝑌̅ − β1ˆ𝑋̅
∑ 𝑥 1000
Where: 𝑋̅ = = = 10
𝑛 100
β0ˆ = 20 − (0.7)*(10)
β0ˆ = 𝟏3.0
Yˆ = 16.5 + 0.35 Xˆ
Meaning: when income of household is zero consumption level is equals to 13 the slope
β1ˆ shows the proportion of income spent for consumption. And shows increasing income
of households by one birr Increases consumption by 0.7.
𝑛
2 ∑𝑖=1 𝑒𝑖 2 15,100
𝛿 = = 100−2 = 154.08
𝑛−2
𝑛
∑𝑖=1 𝑒𝑖 2 = (1 − 𝑅 2 )∑ y2 = ( 1 - 0 . 2 4 5 ) 2 0 , 0 0 0 = 15.100
4. Suppose that we want study about factors affecting the academic performance of third yearEconomics
students in dira Dawa University. Suppose, to this end, data on cumulative GPA, SEX, personal
computer (PC) ownership, and hours of study (HRS) per week and entrance exam results
(EER) were collected from a sample of 10 third year Economics students. Assume further that,
categorical variables are defined as follow.
Personal computer ownership: 1 for students with PC and 0 for students without PC
1 2.5 1 1 6 250
2 1.93 0 0 5 280
3 2.3 0 0 4 319
4 2.77 1 0 9 326
5 2.32 0 0 7 327
6 3.33 1 1 10 350
7 2.42 0 0 12 329
8 2.33 0 0 8 314
9 2.5 0 0 6 316
10 2.75 1 0 7 350
tabulate sex
tabulate pc
------------------------------------------------------------------------------
Group | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval]
---------+--------------------------------------------------------------------
---------+--------------------------------------------------------------------
---------+--------------------------------------------------------------------
------------------------------------------------------------------------------
Pr(T < t) = 0.0069 Pr(|T| > |t|) = 0.0137 Pr(T > t) = 0.9931
d) Test whether there is statistically significant difference b/n mean CGPA of students withPC and
students without PC using meant test
. ttest cgpa , by( pc )
e) Summarize the values of continuous variables (CGPA, HRS & EER) for male and female
separately
Boys:
CGPA HRS EER
Mean 2.3 Mean 7 Mean 314.1667
Standard Standard Standard
0.080125 1.154701 7.254501
Error Error Error
Median 2.325 Median 6.5 Median 317.5
Mode #N/A Mode #N/A Mode #N/A
Standard Standard Standard
0.196265 2.828427 17.76982
Deviation Deviation Deviation
Sample Sample Sample
0.03852 8 315.7667
Variance Variance Variance
Kurtosis 3.444737 Kurtosis 1.66875 Kurtosis 3.851215
Skewness -1.62259 Skewness 1.193243 Skewness -1.83859
Range 0.57 Range 8 Range 49
Minimum 1.93 Minimum 4 Minimum 280
Maximum 2.5 Maximum 12 Maximum 329
Sum 13.8 Sum 42 Sum 1885
Count 6 Count 6 Count 6
Girls:
CGPA HRS EER
Mean 2.3 Mean 7 Mean 314.1667
Standard Standard Standard
0.080125 1.154701 7.254501
Error Error Error
Median 2.325 Median 6.5 Median 317.5
Mode #N/A Mode #N/A Mode #N/A
Standard Standard Standard
0.196265 2.828427 17.76982
Deviation Deviation Deviation
Sample Sample Sample
0.03852 8 315.7667
Variance Variance Variance
Kurtosis 3.444737 Kurtosis 1.66875 Kurtosis 3.851215
f)
Skewness -1.62259 Skewness 1.193243 Skewness -1.83859
Range 0.57 Range 8 Range 49
Minimum 1.93 Minimum 4 Minimum 280
Maximum 2.5 Maximum 12 Maximum 329
Sum 13.8 Sum 42 Sum 1885
Count 6 Count 6 Count 6
f) Show the mean CGPA of male and Female using bar graph
g) Regress CGPA on SEX, PC, HRS and EER
regress cgpa sex pc hrs eer
------------------------------------------------------------------------------
cgpa | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
sex | .2650852 .1037748 2.55 0.051 -.0016764 .5318468
pc | .4495351 .1359566 3.31 0.021 .1000475 .7990226
hrs | .0101844 .0197824 0.51 0.629 -.0406679 .0610368
eer | .0077509 .0016881 4.59 0.006 .0034116 .0120902
_cons | -.2063729 .4765721 -0.43 0.683 -1.43144 1.018695
------------------------------------------------------------------------------
The coefficient for sex (.2650852 ) is not statistically significantly different from 0 because its p-value
is definitely larger than 0.01.
The coefficient for pc (.4495351) is statistically significant because its p-value of 0.021 is less than
0.05.
The coefficient for hrs (.0101844) is not statistically significantly different from 0 because its p-value
is definitely larger than 0.129.
The coefficient for eer (.0077509) is statistically significant because its p-value of 0.006 is less than
0.044.
i) Test for heteroskedasticity, multicollinearity and autocorrelation
heteroskedasticity hettest
Breusch-Pagan / Cook-Weisberg test for heteroskedasticity
Ho: Constant variance
Variables: fitted values of cgpa
chi2(1) = 0.57
Prob > chi2 = 0.4486
multicollinearity vif
Variable | VIF 1/VIF
-------------+----------------------
pc | 2.06 0.485870
sex | 1.80 0.555963
eer | 1.66 0.602703
hrs | 1.43 0.700729
-------------+----------------------
Mean VIF | 1.74
tsset student
delta: 1 unit
---------------------------------------------------------------------------
-------------+-------------------------------------------------------------
1 | 1.722 1 0.1894
---------------------------------------------------------------------------