In: Statistics and Probability
using this model
flog(antibody ratio)jTIME, TREAT, DAYS, FEM, weight, loss, tumor} = TIME + TREAT
report a confidence interval for the difference in mean log ratio between
the BD and NS treatments.
|
> names(case1112)
[1] "Brain" "Liver" "Time" "Treatment" "Days" "Sex"
[7] "Weight" "Loss" "Tumor"
> case1102 = transform(case1102, Y = Brain/Liver)
> case1102 = transform(case1102, logliver = log(Liver))
> case1102 = transform(case1102, logbrain = log(Brain))
> case1102 = transform(case1102, SAC = as.factor(Time))
> case1102 = transform(case1102, logy = log(Brain/Liver))
> case1102 = transform(case1102, logtime = log(Time))
> case1102 = transform(case1102, Treat = relevel(Treatment, ref
= "NS"))
> summary(case1112)
Brain Liver Time Treatment Days
Min. : 1334 Min. : 928 Min. : 0.5 BD:17 Min. : 9
1st Qu.: 19281 1st Qu.: 16210 1st Qu.: 1.1 NS:17 1st Qu.:10
Median : 32572 Median : 643965 Median : 3.0 Median :10
Mean : 39965 Mean : 668776 Mean :23.5 Mean :10
3rd Qu.: 50654 3rd Qu.:1318557 3rd Qu.:24.0 3rd Qu.:10
Max. :123730 Max. :1790863 Max. :72.0 Max. :11
Sex Weight Loss Tumor Y
Female:26 Min. :184 Min. :-4.90 Min. : 25 Min. :0.01
Male : 8 1st Qu.:225 1st Qu.: 1.20 1st Qu.:136 1st Qu.:0.03
Median :240 Median : 3.95 Median :166 Median :0.12
Mean :242 Mean : 3.64 Mean :183 Mean :1.50
3rd Qu.:259 3rd Qu.: 5.97 3rd Qu.:223 3rd Qu.:1.95
Max. :298 Max. :12.80 Max. :484 Max. :8.55
logliver logbrain SAC logy logtime
Min. : 6.83 Min. : 7.20 0.5:9 Min. :-4.58 Min. :-0.69
1st Qu.: 9.69 1st Qu.: 9.86 3 :9 1st Qu.:-3.39 1st Qu.:-0.25
Median :13.37 Median :10.39 24 :8 Median :-2.13 Median : 1.10
Mean :11.61 Mean :10.23 72 :8 Mean :-1.39 Mean : 1.86
3rd Qu.:14.09 3rd Qu.:10.83 3rd Qu.: 0.67 3rd Qu.: 3.18
Max. :14.40 Max. :11.73 Max. : 2.15 Max. : 4.28
Treat
NS:17
BD:17
Graphical presentation:
The following displays a scatterplot of log ratio (Y) as a
function of log time, akin to Display 11.5
on page 315.
> xyplot(Y ~ Time, group = Treat, scales = list(y = list(log =
TRUE), x = list(log = TRUE)),
+ auto.key = TRUE, data = case1102)
> case1102 = transform(case1102, female = ifelse(Sex == "F",
1, 0))
> xyplot(logy ~ jitter(female), xlab = "Sex", data =
case1102)
> xyplot(logy ~ jitter(Days), data = case1102)
Multiple regression:
We first fit a model that reflects the initial investigation.
> lm1 = lm(logy ~ SAC + Treat + SAC * Treat + Days + Sex +
Weight + Loss + Tumor,
+ data = case1102)
> summary(lm1)
Call:
lm(formula = logy ~ SAC + Treat + SAC * Treat + Days + Sex +
Weight + Loss + Tumor, data = case1102)
Residuals:
Min 1Q Median 3Q Max
-1.4056 -0.2559 0.0458 0.1957 1.1583
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -3.836741 3.391046 -1.13 0.271
SAC3 1.015463 0.399578 2.54 0.019
SAC24 4.337135 0.477836 9.08 1.0e-08
SAC72 5.010605 0.454953 11.01 3.5e-10
TreatBD 0.795999 0.378970 2.10 0.048
Days -0.036987 0.295645 -0.13 0.902
SexMale 0.001295 0.373368 0.00 0.997
Weight -0.000558 0.005330 -0.10 0.918
Loss -0.059544 0.030422 -1.96 0.064
Tumor 0.001551 0.001226 1.26 0.220
SAC3:TreatBD 0.179831 0.551964 0.33 0.748
SAC24:TreatBD -0.386047 0.585450 -0.66 0.517
SAC72:TreatBD 0.379104 0.569242 0.67 0.513
Residual standard error: 0.564 on 21 degrees of
freedom
Multiple R-squared: 0.96,Adjusted R-squared:
0.937
F-statistic: 41.9 on 12 and 21 DF, p-value:
6.45e-12
We can then display a residual plot to assess the fit of the above model.
> plot(lm1, which = 1)