InfluentialPoints.com
Biology, images, analysis, design...
Use/Abuse Principles How To Related
"It has long been an axiom of mine that the little things are infinitely the most important" (Sherlock Holmes)

Search this site

 

 

Just a note

Using R
> hosp=read.table('climent.txt',header=T) > mod1=lm(manh~load+xray+beds+popn+stay,data=hosp) > summary(mod1) Call: lm(formula = manh ~ load + xray + beds + popn + stay, data = hosp) Residuals: Min 1Q Median 3Q Max -706.122 -370.105 -1.370 223.879 1576.586 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 2113.97007 1016.45482 2.080 0.0617 . load 26.35950 24.58374 1.072 0.3066 xray 0.05603 0.02145 2.613 0.0241 * beds 0.24161 0.73327 0.329 0.7480 popn -5.72753 6.12260 -0.935 0.3696 stay -427.77354 194.67169 -2.197 0.0503 . --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 646.6 on 11 degrees of freedom Multiple R-squared: 0.9907, Adjusted R-squared: 0.9865 F-statistic: 234.5 on 5 and 11 DF, p-value: 8.708e-11 > library(car) > vif(mod1) load xray beds popn stay 599.852743 7.971065 498.226668 16.720139 3.639526 > # REMOVE BEDS AS HAS VIF >10 and P>others > mod2=update(mod1,~.-beds) > summary(mod2) Call: lm(formula = manh ~ load + xray + popn + stay, data = hosp) Residuals: Min 1Q Median 3Q Max -703.67 -331.60 -83.26 222.80 1582.56 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 2161.99313 967.86599 2.234 0.0453 * load 34.28417 4.89651 7.002 1.43e-05 *** xray 0.05669 0.02055 2.759 0.0173 * popn -6.60062 5.31053 -1.243 0.2376 stay -440.29922 183.69550 -2.397 0.0337 * --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 622.1 on 12 degrees of freedom Multiple R-squared: 0.9906, Adjusted R-squared: 0.9875 F-statistic: 316.6 on 4 and 12 DF, p-value: 4.751e-12 > vif(mod2) load xray popn stay 25.706630 7.902331 13.588353 3.500737 > # REMOVE LOAD AS HAS VIF >10 > mod3=update(mod2,~.-load) > summary(mod3) Call: lm(formula = manh ~ xray + popn + stay, data = hosp) Residuals: Min 1Q Median 3Q Max -3449.9 -739.6 193.3 461.4 2259.3 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -3.075e+03 1.331e+03 -2.310 0.03795 * xray 1.296e-01 3.838e-02 3.376 0.00497 ** popn 2.121e+01 7.636e+00 2.778 0.01567 * stay 5.844e+02 2.405e+02 2.430 0.03035 * --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 1348 on 13 degrees of freedom Multiple R-squared: 0.9523, Adjusted R-squared: 0.9412 F-statistic: 86.44 on 3 and 13 DF, p-value: 7.695e-09 > vif(mod3) xray popn stay 5.874181 5.984406 1.278709