Problem # P120 4.3 RM (LS = List ()) A = read.xlsx ( "xiti_4.xlsx", Sheet =. 3) names (A) = C ( "the ord", "the Y", "K", "L" ) the attach (A) FM = LM (the Y ~ log (K) + log (L)) linear regression model # EI = RESID (FM) X-cbind = (. 1, as.matrix (A [,. 3:. 4])) t = ti (ei, X) # external student residuals plot (fitted (fm), t ) # residuals plotted in FIG.
Seen from the residual figure it out, heterogeneity of variance
a1 = boxcox(fm,lambda = seq(0,1,by=0.1))
It is seen from the image, preferably [lambda] 0, i.e., logarithmic transformation
# Logarithmic transformation lm.log LM = (log (the Y) ~ log (L) + log (K)) Coef (lm.log) Summary (lm.log) the detach (A)
> summary(lm.log) Call: lm(formula = log(Y) ~ log(L) + log(K)) Residuals: Min 1Q Median 3Q Max -1.7251 -0.1764 -0.0059 0.1707 1.3035 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 0.38004 0.26873 1.414 0.166 log(L) 0.05699 0.04471 1.275 0.211 log(K) 0.93065 0.04131 22.526 <2e-16 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 0.441 on 35 degrees of freedom Multiple R-squared: 0.944, Adjusted R-squared: 0.9408 F-statistic: 295 on 2 and 35 DF, p-value: < 2.2e-16