ELMR Exercise 9.2

##       time        poison   treat 
##  Min.   :0.1800   I  :16   A:12  
##  1st Qu.:0.3000   II :16   B:12  
##  Median :0.4000   III:16   C:12  
##  Mean   :0.4794            D:12  
##  3rd Qu.:0.6225                  
##  Max.   :1.2400
##   time poison treat
## 1 0.31      I     A
## 2 0.82      I     B
## 3 0.43      I     C
## 4 0.45      I     D
## 5 0.45      I     A
## 6 1.10      I     B

## 
## Call:
## lm(formula = time ~ poison * treat, data = rats)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.32500 -0.04875  0.00500  0.04312  0.42500 
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)    
## (Intercept)       0.41250    0.07457   5.532 2.94e-06 ***
## poisonII         -0.09250    0.10546  -0.877   0.3862    
## poisonIII        -0.20250    0.10546  -1.920   0.0628 .  
## treatB            0.46750    0.10546   4.433 8.37e-05 ***
## treatC            0.15500    0.10546   1.470   0.1503    
## treatD            0.19750    0.10546   1.873   0.0692 .  
## poisonII:treatB   0.02750    0.14914   0.184   0.8547    
## poisonIII:treatB -0.34250    0.14914  -2.297   0.0276 *  
## poisonII:treatC  -0.10000    0.14914  -0.671   0.5068    
## poisonIII:treatC -0.13000    0.14914  -0.872   0.3892    
## poisonII:treatD   0.15000    0.14914   1.006   0.3212    
## poisonIII:treatD -0.08250    0.14914  -0.553   0.5836    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1491 on 36 degrees of freedom
## Multiple R-squared:  0.7335, Adjusted R-squared:  0.6521 
## F-statistic:  9.01 on 11 and 36 DF,  p-value: 1.986e-07

## [1] -0.8282828
## 
## Call:
## lm(formula = time^-0.8 ~ poison * treat, data = rats)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.53028 -0.20178 -0.04498  0.17881  0.67094 
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)    
## (Intercept)       2.06799    0.16418  12.596 9.31e-15 ***
## poisonII          0.50160    0.23218   2.160 0.037475 *  
## poisonIII         1.43855    0.23218   6.196 3.81e-07 ***
## treatB           -0.94127    0.23218  -4.054 0.000257 ***
## treatC           -0.43017    0.23218  -1.853 0.072136 .  
## treatD           -0.55060    0.23218  -2.371 0.023191 *  
## poisonII:treatB  -0.33698    0.32835  -1.026 0.311611    
## poisonIII:treatB -0.14128    0.32835  -0.430 0.669560    
## poisonII:treatC   0.08011    0.32835   0.244 0.808629    
## poisonIII:treatC  0.11410    0.32835   0.347 0.730248    
## poisonII:treatD  -0.50444    0.32835  -1.536 0.133217    
## poisonIII:treatD -0.48988    0.32835  -1.492 0.144435    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.3284 on 36 degrees of freedom
## Multiple R-squared:  0.8633, Adjusted R-squared:  0.8216 
## F-statistic: 20.68 on 11 and 36 DF,  p-value: 2.371e-12
## 
## Call:
## glm(formula = time ~ poison * treat, family = inverse.gaussian(link = "identity"), 
##     data = rats)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -0.6987  -0.2145   0.0238   0.1703   0.5229  
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)    
## (Intercept)       0.41250    0.04062  10.155 4.12e-12 ***
## poisonII         -0.09250    0.04920  -1.880   0.0682 .  
## poisonIII        -0.20250    0.04322  -4.685 3.91e-05 ***
## treatB            0.46750    0.13293   3.517   0.0012 ** 
## treatC            0.15500    0.07712   2.010   0.0520 .  
## treatD            0.19750    0.08359   2.363   0.0237 *  
## poisonII:treatB   0.02750    0.17655   0.156   0.8771    
## poisonIII:treatB -0.34250    0.13701  -2.500   0.0171 *  
## poisonII:treatC  -0.10000    0.08920  -1.121   0.2697    
## poisonIII:treatC -0.13000    0.08044  -1.616   0.1148    
## poisonII:treatD   0.15000    0.12145   1.235   0.2248    
## poisonIII:treatD -0.08250    0.08951  -0.922   0.3628    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for inverse.gaussian family taken to be 0.09403976)
## 
##     Null deviance: 25.7437  on 47  degrees of freedom
## Residual deviance:  3.6418  on 36  degrees of freedom
## AIC: -84.797
## 
## Number of Fisher Scoring iterations: 3