The R Project SVN R

Rev

Rev 64891 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 64891 Rev 75334
Line 66... Line 66...
66
(IM <- influence.measures(lm.SR))
66
(IM <- influence.measures(lm.SR))
67
summary(IM)
67
summary(IM)
68
## colnames will differ in the next line
68
## colnames will differ in the next line
69
all.equal(dfbetas(lm.SR), IM$infmat[, 1:5], check.attributes = FALSE,
69
all.equal(dfbetas(lm.SR), IM$infmat[, 1:5], check.attributes = FALSE,
70
          tolerance = 1e-12)
70
          tolerance = 1e-12)
71
 
-
 
72
signif(dfbeta(lm.SR), 3)
71
signif(dfbeta(lm.SR), 3)
73
covratio (lm.SR)
72
covratio (lm.SR)
74
 
73
 
-
 
74
## Multivariate lm ("mlm") --- Example from  ?SSD
-
 
75
reacttime <- matrix(c(
-
 
76
420, 420, 480, 480, 600, 780,
-
 
77
420, 480, 480, 360, 480, 600,
-
 
78
480, 480, 540, 660, 780, 780,
-
 
79
420, 540, 540, 480, 780, 900,
-
 
80
540, 660, 540, 480, 660, 720,
-
 
81
360, 420, 360, 360, 480, 540,
-
 
82
480, 480, 600, 540, 720, 840,
-
 
83
480, 600, 660, 540, 720, 900,
-
 
84
540, 600, 540, 480, 720, 780,
-
 
85
480, 420, 540, 540, 660, 780),
-
 
86
ncol = 6, byrow = TRUE,
-
 
87
dimnames = list(subj = 1:10,
-
 
88
              cond = c("deg0NA", "deg4NA", "deg8NA",
-
 
89
                       "deg0NP", "deg4NP", "deg8NP")))
-
 
90
mlmfit <- lm(reacttime ~ 1)
-
 
91
ImMLM <- influence.measures(mlmfit)## fails in R <= 3.5.1
-
 
92
## and the print() and summary() methods had failed additionally:
-
 
93
oo <- capture.output(ImMLM) # now ok
-
 
94
summary(ImMLM) # "ok"
-
 
95
 
-
 
96
 
-
 
97
 
75
## predict.lm(.)
98
## predict.lm(.)
76
 
99
 
77
all.equal(predict(roller.lm,                 se.fit=TRUE)$se.fit,
100
all.equal(predict(roller.lm,                 se.fit=TRUE)$se.fit,
78
          predict(roller.lm, newdata=roller, se.fit=TRUE)$se.fit, tolerance =  1e-14)
101
          predict(roller.lm, newdata=roller, se.fit=TRUE)$se.fit, tolerance =  1e-14)