Presentation is loading. Please wait.

Presentation is loading. Please wait.

From Anova to Regression: analyzing the effect on consumption of no. of persons in family Family consumption data family.dta E/Albert/Courses/cdas/appstat00/From.

Similar presentations


Presentation on theme: "From Anova to Regression: analyzing the effect on consumption of no. of persons in family Family consumption data family.dta E/Albert/Courses/cdas/appstat00/From."— Presentation transcript:

1 From Anova to Regression: analyzing the effect on consumption of no. of persons in family Family consumption data family.dta E/Albert/Courses/cdas/appstat00/From anova to regression

2 Histogram of the consumption data. use "I:\ade-eco\APL_STAT\As2002\family.dta", clear. graph exp1_1, bin(12) normal

3 Log-transformation y = ln(food) generate lfood = ln(exp1_1). graph lfood, bin(20) normal

4 Power Transformation x --> x* x* = (x - 1)/ x* = ln (x) when = 0

5 Box-Cox Transformation. boxcox exp1_1, nolog level(95) gen(newfood) Transform: (exp1_1^L-1)/L L [95% Conf. Interval] Log Likelihood ---------------------------------------------------- 0.3670 0.3382 0.4072 684.63356 Test: L == -1 chi2(1) = 47323.87 Pr>chi2 = 0.0000 L == 0 chi2(1) = 1141.84 Pr>chi2 = 0.0000 L == 1 chi2(1) = 910.66 Pr>chi2 = 0.0000.

6 Distrib. of transform. var.

7 Comparison of distributions

8 One-way ANOVA. oneway newfood nmemb_1, tabulate scheffe number | Summary of BC(exp1_1,.367) members | Mean Std. Dev. Freq. ------------+------------------------------------ 1 | -.54646644.55918587 269 2 |.0042595.55767657 612 3 |.30043252.55347515 589 4 |.50565614.58054826 675 5 |.64489038.54040512 307 6 |.89943188.54306837 126 7 | 1.0034046.7149304 42 8 | 1.4943582 1.0579128 12 9 | 1.2014463.37134539 6 10 | 1.7167094 0 1 11 | 1.6762753 0 1 ------------+------------------------------------ Total |.28631315.68660233 2640 Analysis of Variance Source SS df MS F Prob > F ------------------------------------------------------------------------ Between groups 402.78829 10 40.278829 125.87 0.0000 Within groups 841.296369 2629.320006226 ------------------------------------------------------------------------ Total 1244.08466 2639.471422758 -

9 Regression. regress newfood nmemb_1 Source | SS df MS Number of obs = 2640 ---------+------------------------------ F( 1, 2638) = 1126.51 Model | 372.28551 1 372.28551 Prob > F = 0.0000 Residual | 871.799149 2638.330477312 R-squared = 0.2992 ---------+------------------------------ Adj R-squared = 0.2990 Total | 1244.08466 2639.471422758 Root MSE =.57487 ------------------------------------------------------------------------------ newfood | Coef. Std. Err. t P>|t| [95% Conf. Interval] ---------+-------------------------------------------------------------------- nmemb_1 |.2536583.0075576 33.563 0.000.2388389.2684777 _cons | -.5511436.0273451 -20.155 0.000 -.6047636 -.4975236 ------------------------------------------------------------------------------.

10 Regression fit graph yhat newfood nmemb_1, c(s.) s(iO)


Download ppt "From Anova to Regression: analyzing the effect on consumption of no. of persons in family Family consumption data family.dta E/Albert/Courses/cdas/appstat00/From."

Similar presentations


Ads by Google