-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdev_tst.R
68 lines (47 loc) · 1.69 KB
/
dev_tst.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
print.default(sumry(lm(Sepal.Length ~ Sepal.Width, data = iris)))
print.default(sumry(lm(Sepal.Length ~ Sepal.Length, data = iris)))
print.sumry.lm(sumry(lm(Sepal.Length ~ Sepal.Width, data = iris)))
expect_snapshot(print.sumry.lm(sumry(lm(
hwy ~ displ + year + cyl + fl, data = mpg
))))
expect_snapshot(print.sumry.lm(sumry(lm(
hwy ~ displ + year + cyl * fl, data = mpg
))))
expect_snapshot(print.sumry.lm(sumry(
lm(hwy ~ displ + year + cyl + trans * fl, data = mpg)
)))
expect_snapshot(print.sumry.lm(sumry(
lm(hwy ~ displ + year + cyl * trans * fl, data = mpg)
)))
mdl <- lm(Sepal.Length ~ Sepal.Width + Petal.Length, data = iris)
rslt <- lm_plot.infl(mdl)
mdl <- lm(hwy ~ displ + year + cyl + fl, data = mpg)
mdl <- lm(hwy ~ year + cyl * fl, data = mpg)
ql <- quantile(df$.resid, c(0.25, 0, 0.75))
outl.lim <- ql[c(1, 3)] + c(-1.5, 1.5) * (ql[3] - ql[1])
which(df$.resid < outl.lim[1] | df$.resid > outl.lim[2])
lm_plot.lst <- lm_plot.4way(mdl)
lm_plot.lst$p_4way
mdl <- lm(Sepal.Length ~ Sepal.Width + Petal.Length + Species, data = iris)
mdl <- lm(Sepal.Length ~ Sepal.Width + Petal.Length, data = iris)
lm_plot.lst <- lm_plot.4way(mdl)
lm_plot.lst$p_4way
infl <- influence.measures(mdl)
object <- mdl
sumry <- sumry.lm(mdl)
print.sumry.lm(sumry)
object <- lm(hwy ~ displ + year + cyl * fl, data = mpg)
sumry.lm(object)
object <- lm(hwy ~ displ + year + cyl + trans * fl, data = mpg)
sumry.lm(object)
## check of default printing of a complex object ----
fil <- tempfile("sumry")
sink(file = fil)
print.default((sumry(lm(
Sepal.Length ~ Sepal.Width, data = iris
))), width = 75)
sink()
lins <- readLines(fil)
lins <- sub(".*nvironment.*", "", lins)
cat(paste(lins, "\n"))
file.remove(fil)