DEMO PROGRAM 3 from LAB 4: /**************************************************** * Scenario: Researchers record ages of rats in * * weeks, total radiation dosage, and count=number of * * damaged cells (average of 5 determinations) found * * when rats are sacrificed. The rats are exposed to * * a constant radiation source in their cages and the * * total (cumulative) dose is measured by a collar * * device. If they did not move around with respect * * to the source, dosage would be exactly a linear * * function of weeks and we could not invert X’X. * * * * In this demo, we see that if X1 and X2 (age and * * dose) are highly collinear, we have VERY unstable * * estimates of our parameters. Notice that the * * model F test says we cannot omit both X1 and X2, * * but our t tests say we CAN omit either one. * * They (X1 and X2; Age and Dose) are REDUNDANT in a * * sense. Look at the plot to see the idea. * * * * Note that we are NOT saying that age and dose do * * not affect count, nor are we saying that age and * * dose would be related in some population like they * * are in this sample. We ARE saying that by the way * * we did the experiment, we have collected data that * * does NOT ALLOW us to determine which of these two * * variables is important! – a very poor design. * ******************************************************/ Data rats; input weeks radiation; count = 5 + .3*weeks + .2*radiation + round(4*normal(123)); cards; 18 35 27 45 56 73 40 57 84 100 70 88 10 25 50 68 ; proc print; proc g3d; scatter weeks*radiation=count; proc reg; model count = weeks radiation/SS1 SS2; * get the sequential (SS1) and partial (SS2) sums of squares *; run; Analysis of Variance Source Model Error Corrected Total DF 2 5 7 Sum of Squares 1124.49930 67.68945 1192.18875 Mean Square 562.24965 13.53789 Parameter Estimates F Value 41.53 Pr > F 0.0008 Variable DF Parameter Estimate Standard Error t Value Pr > |t| Type I SS Type II SS Intercept weeks radiation 1 1 1 11.32486 0.65124 -0.15497 22.30709 1.34848 1.33489 0.51 0.48 -0.12 0.6333 0.6495 0.9121 7546.06125 1124.31685 0.18246 3.48924 3.15753 0.18246 Add in weight of rat (should be related to weeks – right?) Source Model Error Corrected Total DF Sum of Squares Mean Square 3 4 7 1125.66559 66.52316 1192.18875 375.22186 16.63079 F Value Pr > F 22.56 0.0057 Variable DF Parameter Estimate Standard Error t Value Pr > |t| Type I SS Type II SS Intercept weeks radiation weight 1 1 1 1 9.80542 0.22179 -0.50886 2.43431 25.38133 2.20540 1.99370 9.19243 0.39 0.10 -0.26 0.26 0.7189 0.9247 0.8111 0.8042 7546.06125 1124.31685 0.18246 1.16629 2.48208 0.16820 1.08339 1.16629 H 0 : 2 3 0 (no radiation or weight effect) F42 (0.1825 1.1663) / 2 0.04 16.6308 (critical value is 6.94, p-value is 0.9607. Cannot reject, i.e. no evidence of radiation or weight effect). H0 : 2 0 , F41 1.0834 0.07 16.6308 p-value is 0.8111 (same as t) Or use t = -0.26 t2=F for calculated test statistics (SINGLE parameter only!) Also critical value for F is square of t critical value.