#################################################################### > names(prestige) [1] "education" "income" "percent.female" "occ.prestige" [5] "occ.code" "occ.type" > motif() > pairs(prestige[,1:4]) > ##################################################################### > fit.ed _ lm(occ.prestige ~ education,data=prestige) > fit.ed Call: lm(formula = occ.prestige ~ education, data = prestige) Coefficients: (Intercept) education -10.73198 5.360878 Degrees of freedom: 102 total; 100 residual Residual standard error: 9.103291 > > par(mfrow=c(2,2)) > > plot(prestige$education,prestige$occ.prestige) > abline(fit.ed) > > plot(fitted(fit.ed),prestige$occ.prestige) > abline(0,1) > > plot(prestige$education,residuals(fit.ed)) > abline(0,0) > > plot(fitted(fit.ed),residuals(fit.ed)) > abline(0,0) > > par(mfrow=c(2,3)) > plot(fit.ed) > ########################################################## > fit.in _ lm(occ.prestige ~ income, data=prestige) > fit.in Call: lm(formula = occ.prestige ~ income, data = prestige) Coefficients: (Intercept) income 27.14118 0.002896799 Degrees of freedom: 102 total; 100 residual Residual standard error: 12.08974 > > par(mfrow=c(2,2)) > > plot(prestige$income,prestige$occ.prestige) > abline(fit.in) > > plot(fitted(fit.in),prestige$occ.prestige) > abline(0,1) > > plot(prestige$income,residuals(fit.in)) > abline(0,0) > > plot(fitted(fit.in),residuals(fit.in)) > abline(0,0) > > par(mfrow=c(2,3)) > plot(fit.in) > ################################################################ > fit.pf _ lm(occ.prestige ~ percent.female, data=prestige) > fit.pf Call: lm(formula = occ.prestige ~ percent.female, data = prestige) Coefficients: (Intercept) percent.female 48.693 -0.06417284 Degrees of freedom: 102 total; 100 residual Residual standard error: 17.16881 > > > par(mfrow=c(2,2)) > > plot(prestige$percent.female,prestige$occ.prestige) > abline(fit.pf) > > plot(fitted(fit.pf),prestige$occ.prestige) > abline(0,1) > > plot(prestige$percent.female,residuals(fit.in)) > abline(0,0) > > plot(fitted(fit.pf),residuals(fit.pf)) > abline(0,0) > > par(mfrow=c(2,3)) > plot(fit.pf) > ####################################################################### > summary(fit.ed) Call: lm(formula = occ.prestige ~ education, data = prestige) Residuals: Min 1Q Median 3Q Max -26.04 -6.523 0.6611 6.743 18.16 Coefficients: Value Std. Error t value Pr(>|t|) (Intercept) -10.7320 3.6771 -2.9186 0.0043 education 5.3609 0.3320 16.1478 0.0000 Residual standard error: 9.103 on 100 degrees of freedom Multiple R-Squared: 0.7228 F-statistic: 260.8 on 1 and 100 degrees of freedom, the p-value is 0 Correlation of Coefficients: (Intercept) education -0.9695 > > > summary(fit.in) Call: lm(formula = occ.prestige ~ income, data = prestige) Residuals: Min 1Q Median 3Q Max -33.01 -8.378 -2.378 8.432 32.08 Coefficients: Value Std. Error t value Pr(>|t|) (Intercept) 27.1412 2.2677 11.9686 0.0000 income 0.0029 0.0003 10.2243 0.0000 Residual standard error: 12.09 on 100 degrees of freedom Multiple R-Squared: 0.5111 F-statistic: 104.5 on 1 and 100 degrees of freedom, the p-value is 0 Correlation of Coefficients: (Intercept) income -0.8493 > > > summary(fit.pf) Call: lm(formula = occ.prestige ~ percent.female, data = prestige) Residuals: Min 1Q Median 3Q Max -33.44 -12.39 -4.126 13.03 39.18 Coefficients: Value Std. Error t value Pr(>|t|) (Intercept) 48.6930 2.3076 21.1011 0.0000 percent.female -0.0642 0.0538 -1.1917 0.2362 Residual standard error: 17.17 on 100 degrees of freedom Multiple R-Squared: 0.014 F-statistic: 1.42 on 1 and 100 degrees of freedom, the p-value is 0.2362 Correlation of Coefficients: (Intercept) percent.female -0.6762 > ####################################################################### > > fit.all3 _ lm(occ.prestige ~ education + income + percent.female,data=prestige) > fit.all3 Call: lm(formula = occ.prestige ~ education + income + percent.female, data = prestige) Coefficients: (Intercept) education income percent.female -6.794334 4.186637 0.00131356 -0.008905157 Degrees of freedom: 102 total; 98 residual Residual standard error: 7.846467 > > par(mfrow=c(2,3)) > plot(fit.all3) > ###################################################################### > summary(fit.all3) Call: lm(formula = occ.prestige ~ education + income + percent.female, data = prestige) Residuals: Min 1Q Median 3Q Max -19.82 -5.333 -0.1364 5.159 17.5 Coefficients: Value Std. Error t value Pr(>|t|) (Intercept) -6.7943 3.2391 -2.0976 0.0385 education 4.1866 0.3887 10.7708 0.0000 income 0.0013 0.0003 4.7288 0.0000 percent.female -0.0089 0.0304 -0.2929 0.7702 Residual standard error: 7.846 on 98 degrees of freedom Multiple R-Squared: 0.7982 F-statistic: 129.2 on 3 and 98 degrees of freedom, the p-value is 0 Correlation of Coefficients: (Intercept) education income education -0.7774 income 0.1280 -0.6752 percent.female -0.0563 -0.4321 0.5852 >