Comparison of 3 different methods of linear regression: (1) Least-squares (2) ``Theil'' linear regression (3) Rank regression Output of program RANKREGRESS Written or modified by YOURNAME Starting random-number seed: 123456 (Enter a number on the command line to specify a different seed.) Prepacked Lubricants and Survival Times for Engines (Source of data unknown) Lubricants Survival Lubricants Survival --------------------------------------------------------- 1. 29 23 11. 84 429 2. 21 36 12. 37 489 3. 30 67 13. 94 504 4. 45 104 14. 56 925 5. 48 147 15. 67 980 6. 92 164 16. 79 1254 7. 74 247 17. 70 2961 8. 61 304 18. 93 5351 9. 99 355 19. 76 9915 10. 24 408 20. 72 11301 --------------------------------------------------------- (The last two columns below are the errors MADf = (1/n)Sum(i=1,n) |Y_i-beta*X_i-mu| and RMS = Root( (1/n)Sum(i=1,n)(Y_i-beta*X_i-mu)^2 ) REGRESSIONS for Y(Survival Time) on X(Lubricants): MADf RMS LeastSqrs: Y = 37.9242 X + -573.961 2010.12 3050.92 Theil: Y = 7.1050 X + 179.280 1614.72 3354.75 RankRegr: Y = 6.8281 X + 197.914 1615.16 3355.82 REGRESSIONS for log(Y)(Survival Time) on X(Lubricants): MADf RMS LeastSqrs: log(Y) = 0.0373 X + 3.826 1.23 1.40 Theil: log(Y) = 0.0340 X + 3.984 1.23 1.40 RankRegr: log(Y) = 0.0357 X + 3.880 1.23 1.40 CONFIDENCE INTERVALS and P-VALUES for SLOPE: LEAST-SQUARES REGRESSION (normal-theory) for Y = beta*X + mu Confidence interval and P-value for beta Beta=37.9242 95% CI (-23.9214, 99.7698) (18 df) Pval(beta!=0): 0.213956 (two-sided, 18 df) (LEAST SQUARES) BOOTSTRAP for beta in Y = beta*X + mu: Medians and 95% confidence intervals, 10,000 replications. BOOTSTRAP ON OBSERVATIONS (least squares, beta=37.9242): Beta=36.1494 95% CI (5.7296, 89.3095) Bias: 0.5383 Bootstrap Pvalue for H_0:beta=0 vs. H_1:beta!=0: One-sided P: P=53/10,000=0.00530 Two-sided P: P=0.01060 95% CI: (0.007754, 0.013446) BOOTSTRAP ON RESIDUALS (least squares, beta=37.9242): Beta=38.5161 95% CI (-18.2171, 90.6865) Bias: 0.4915 Bootstrap Pvalue for H_0:beta=0 vs. H_1:beta!=0: One-sided P: P=829/10,000=0.08290 Two-sided P: P=0.16580 95% CI: (0.154991, 0.176609) LEAST-SQUARES REGRESSION (normal-theory) for log(Y) = beta*X + mu Confidence interval and P-value for beta Beta=0.0373138 95% CI (0.0090, 0.0656) (18 df) Pval(beta!=0): 0.0126445 (two-sided, 18 df) DISTRIBUTION-FREE EXACT 95% CI for Theil's estimator: Large-sample approximations, Y = beta*X + mu: Beta=7.1050 95% CI (1.3421, 33.0000) (attained at diff.ratio offsets 64,127 in (1,190)) Large-sample P-value for H_0:beta=0: Z=2.33599 P=0.0195 (2-sided) (THEIL REGRESSION) BOOTSTRAP for beta in Y = beta*X + mu: Medians and 95% confidence intervals, 10,000 replications. BOOTSTRAP ON OBSERVATIONS (Theil, beta=7.10497): Beta=6.8281 95% CI (1.2766, 51.1250) Bias: 0.5144 Bootstrap Pvalue for H_0:beta=0 vs. H_1:beta!=0: One-sided P: P=120/10,000=0.01200 Two-sided P: P=0.02400 95% CI: (0.019732, 0.028268) BOOTSTRAP ON RESIDUALS (Theil, beta=7.10497): Beta=7.1050 95% CI (-3.2275, 16.9209) Bias: 0.5388 Bootstrap Pvalue for H_0:beta=0 vs. H_1:beta!=0: One-sided P: P=527/10,000=0.05270 Two-sided P: P=0.10540 95% CI: (0.096641, 0.114159) (RANK REGRESSION) BOOTSTRAP for beta in Y = beta*X + mu: Medians and 95% confidence intervals, 10,000 replications. BOOTSTRAP ON OBSERVATIONS (rank regression, beta=6.82813): Beta=6.8281 95% CI (1.3714, 71.6377) Bias: 0.5091 Bootstrap Pvalue for H_0:beta=0 vs. H_1:beta!=0: One-sided P: P=51/10,000=0.00510 Two-sided P: P=0.01020 95% CI: (0.007408, 0.012992) BOOTSTRAP ON RESIDUALS (rank regression, beta=6.82813): Beta=6.8281 95% CI (-6.5741, 18.2744) Bias: 0.5968 Bootstrap Pvalue for H_0:beta=0 vs. H_1:beta!=0: One-sided P: P=852/10,000=0.08520 Two-sided P: P=0.17040 95% CI: (0.159456, 0.181344) SUMMARY of estimates, confidence intervals, and P-values: Least Squares (Y): Classical 37.92423 (-23.92137, 99.76983) P=0.21396 (df=18) BootObs 36.14940 ( 5.72961, 89.30950) P=0.01060 BootResid 38.51612 (-18.21708, 90.68653) P=0.16580 Least Squares (log(Y)): Classical 0.03731 ( 0.00900, 0.06562) P=0.01264 (df=18) Theil Regression (Y): Approx 7.10497 ( 1.34211, 33.00000) P=0.01949 BootObs 6.82813 ( 1.27660, 51.12500) P=0.02400 BootResid 7.10497 ( -3.22754, 16.92085) P=0.10540 Rank Regression (Y): BootObs 6.82813 ( 1.37143, 71.63768) P=0.01020 BootResid 6.82813 ( -6.57414, 18.27441) P=0.17040 Random numbers used: 1,200,000