Presentation is loading. Please wait.

Presentation is loading. Please wait.

Prediction, Goodness-of-Fit, and Modeling Issues

Similar presentations


Presentation on theme: "Prediction, Goodness-of-Fit, and Modeling Issues"— Presentation transcript:

1 Prediction, Goodness-of-Fit, and Modeling Issues
Chapter 4. Prediction, Goodness-of-Fit, and Modeling Issues E-Seul An Gloria Nalule

2 Contents Prediction in the food expenditure model
Measuring Goodness-of-fit Modeling issues The log-linear model Conclusion

3 4.1 Prediction in the Food expenditure model
Open Eviews work file, “food_ch4” 2. Quick > Estimate Equation 3. Write “food_exp c income” > OK 4. Click “Name” 5. Fill the name as “food_eq” > OK

4 4.1.1 A simple prediction procedure
To obtain the predicted food expenditure for a household with income of $2000, On “food_eq”, Click View > Representations Copy and paste the substituted coefficients FOOD_EXP = *INCOME 3. Edit the command to scalar FOOD_EXP_hat = *20

5 For 95% prediction interval the required critical value is 𝑡 𝑐 is the 97.5 percentile.
Write scalar in command box Write following commands to get the prediction intervals scalar scalar scalar scalar scalar varf=sig2+sig2/n+(20-xbar)^2*varb2 scalar scalar yhat_lb=food_exp_hat-tc*sef scalar yhat_ub=food_exp_hat+tc*sef show yhat_lb show yhat_ub -tc tc 0.025 t f(t) 0.95

6 4.1.2 Prediction using EViews
Double click on Range in the main workfile Change the number of observations to 43 Open INCOME series Click Edit+/- to open edit mode Enter 20, 25 and 30 in cells 41-43 Click Edit+/- to close edit mode 앞에서 직접 수식을 써서 구했던 값을, Eviews를 통해 구해보겠음.

7 In the “Food_eq” window, Click “forecast”
Enter names for Forecast and the S.E To create upper bound and lower bound by using newly created “food_expf” and “food_sef”, 3. Enter the following commands series food_exp_ub=food_expf+tc*food_sef series food_exp_lb=food_expf-tc*food_sef 4. Click “food_exp_lb”, “food_exp_ub”, “food_expf”, “food_sef”, and “income” while holding Ctrl. 5. Open > as Group

8 Click Name Change the name to “food_predictions” Compare the upper and lower bound with previous values that we computed manually We have the same results!

9 4.2 Measuring goodness-of-fit
4.2.1 Calculating 𝑅 2 You can fine 𝑅 2 on the “food_eq” To compute the 𝑅 2 manually, Put the command below scalar scalar 3. You get the same result with 𝑅 2

10 4.2 Measuring goodness-of-fit
4.2.2 Correlation analysis By using the relationship, 𝑅 2 = 𝑟 𝑥𝑦 2 , we can compute 𝑅 2 as The square of the correlation between X and Y The square of the correlation between Y and its predicted values Put the commands below scalar scalar

11 4.3. Modeling issues 4.3.1 The effects of scaling the data changed
For practice, suppose we measure INCOME in $ rather than in 100$ And Estimate the food expenditure model using new variable Enter the commands below series dollar_inc=100*income ls food_exp c dollar_inc You can get the same result if you enter ls food_exp c (100*income) changed

12 4.3.2 The log-linear model To estimate the log-linear version of the food expenditure model, First generate the log of the dependent variable Enter the command below series lfood_exp=log(food_exp) Use this dependent variable in the regression model 2. Enter the command below ls lfood_exp c income You can get the same result if you enter ls log(food_exp) c income Interpretation : An increase in income of $100(1 unit) leads to about 4% increase in food expenditure

13 4.3.3 The linear-log model To estimate the linear-log version of the food expenditure model, First transforms the x variable. Enter the command below series lincome=log(income) Use this variable in the regression model 2. Enter the command below ls food_exp c lincome You can get the same result if you enter ls food_exp c log(income) Interpretation : A 1% increase in income leads to about $1.32 increase in weekly food expenditure

14 4.3.4 The log-log model To estimate the log-log version of the food expenditure model, First create the regression command Enter the command below ls lfood_exp c lincome You can get the same result if you enter ls log(food_exp) c log(income) Interpretation : A 1% increase in income leads to about 0.56% increase in food expenditure

15 4.3.5 Are the regression errors normally distributed?
One aspect of the error that we can examine is whether the errors appear normally distributed = On ‘food_eq’ window, Click view > residual tests > histogram-normality test Residuals are centered at zero Skewness is close to 0 Kurtosis is nearly 3 Probability(P-value) > (fail to reject 𝑯 𝟎 )

16 When the residuals are normally distributed, the Jarque-Berra statistic has a chi-square distribution with 2df. If the JB exceeds a critical value, we are able to reject 𝐻 0 =normally distributed errors Obtain the critical value for the chi-square distribution by typing the command, scalar The critical value is 5.99 You can also fine it on the chi-square distribution table Interpretation Because 0.063<5.99, there is Insufficient evidence from the residuals to conclude that the normal distribution assumption is unreasonable at the 5% level of significance. Therefore, we fail to reject null hypothesis,

17 4.3.6 Another example Double click!
4. Choose the Workfile structure type to “Dated-regular frequency” 5. Choose the Frequency to “Annual” with Start date 1950 and End date 1997 6. Click OK File > Open> Eviews Workfile Select “wa-wheat.wf1’ > OK Double-click on Range You can fine the range and sample are changed

18 Yield = 0.63778+0.021032(time) (se) (0.064131) (0.002279)
Estimate the linear regression of YIELD in GREENOUGH shire on TIME By entering command, equation linear.ls greenough c time Yield = (time) (se) ( ) ( )

19 To open the residual graph, on the RESID window
Click View > Graph Select Basic Type > Bar > OK We can consider the functional form, 𝑌𝑖𝑒𝑙𝑑 𝑡 = 𝛽 1 + 𝛽 2 (𝑡𝑖𝑚𝑒) 3 + 𝑒 𝑡

20 Because ‘time^3’ is large number, let’s define 𝑡𝑖𝑚𝑒𝑐𝑢𝑏𝑒 𝑡 = 𝑡𝑖𝑚𝑒 𝑡 3 /1000000
To generate the cubic equation, enter the commands below 1. genr timecube=(time^3)/ 2. equation cubic.ls greenough c timecube Or enter single command, equation cubic.ls greenough c (time^3)/ Yield= (timecube) (se) ( ) ( ) Time^3 값이 너무 크게 나오기 때문에, 숫자를 좀 줄이기 위해서, timecube=time^3/ 으로 정의한다.

21 4.4 The log-linear model Click File> Open> Eviews workfile
Select ‘cps_small.wf1’ Create new series by enter the command below series lwage=log(wage) equation lwage_eq.ls lwage c educ ln(wage)= (education) (se) ( ) ( ) Additional year of education increases the wage rate by 10.4%

22 4.4.1 Prediction in the log-linear model
First, we illustrate prediction with the equation lwage_eq in which we regressed the series lwage on education Click Forecast Enter the names for forecast and S.E Click OK Enter the commands below scalar series w_ub=exp(lwagef+tc*lwage_sef) series w_lb=exp(lwage-tc*lwage_sef) series w_n=exp(lwagef) scalar series w_c=exp(lwagef)*exp(sig2/2)

23 The values of the actual wage, the prediction interval(LB
The values of the actual wage, the prediction interval(LB. UB), and the natural and corrected predictors are shown below The corrected predictor is larger than the natural predictor because the correction factor is larger than one series w_n=exp(lwagef) scalar series w_c=exp(lwagef)*exp(sig2/2)

24 4.4.2 Alternative commands in the log-linear model
Instead of creating a new variable ‘lwage’, we can enter the command, equation wage_eq.ls log(wage) c educ 4.4.3 Generalized 𝑅 2 A generalized goodness of fit measure is the squared correlation between the actual value of the dependent variable and its best predictor. You can get the value by enter the command, scalar

25 Summary 𝑅 2 = 𝑆𝑆𝑅 𝑆𝑆𝑇 =1− 𝑆𝑆𝐸 𝑆𝑆𝑇 , (SST=SSR+SSE) 𝑅 2 = 𝑟 𝑥𝑦 2
𝑅 2 = 𝑟 𝑥𝑦 2 The log-linear model : ln(y)= 𝛽 1 + 𝛽 2 𝑥 1 unit increase in x leads to a 100 𝛽 2 % change in y The linear-log model : y= 𝛽 1 + 𝛽 2 ln 𝑥 1% increase in x leads to a 𝛽 2 /100-unit change in y The log-log model : ln(y)= 𝛽 1 + 𝛽 2 ln⁡(𝑥) 𝛽 2 is the elasticity of y with respect to x


Download ppt "Prediction, Goodness-of-Fit, and Modeling Issues"

Similar presentations


Ads by Google