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
Histogram of the consumption data. use "I:\ade-eco\APL_STAT\As2002\family.dta", clear. graph exp1_1, bin(12) normal
Log-transformation y = ln(food) generate lfood = ln(exp1_1). graph lfood, bin(20) normal
Power Transformation x --> x* x* = (x - 1)/ x* = ln (x) when = 0
Box-Cox Transformation. boxcox exp1_1, nolog level(95) gen(newfood) Transform: (exp1_1^L-1)/L L [95% Conf. Interval] Log Likelihood Test: L == -1 chi2(1) = Pr>chi2 = L == 0 chi2(1) = Pr>chi2 = L == 1 chi2(1) = Pr>chi2 =
Distrib. of transform. var.
Comparison of distributions
One-way ANOVA. oneway newfood nmemb_1, tabulate scheffe number | Summary of BC(exp1_1,.367) members | Mean Std. Dev. Freq | | | | | | | | | | | Total | Analysis of Variance Source SS df MS F Prob > F Between groups Within groups Total
Regression. regress newfood nmemb_1 Source | SS df MS Number of obs = F( 1, 2638) = Model | Prob > F = Residual | R-squared = Adj R-squared = Total | Root MSE = newfood | Coef. Std. Err. t P>|t| [95% Conf. Interval] nmemb_1 | _cons |
Regression fit graph yhat newfood nmemb_1, c(s.) s(iO)