Skip to content

Commit 135282a

Browse files
author
ripley
committed
add some regression examples
git-svn-id: https://svn.r-project.org/R/trunk@87477 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent a01b4e8 commit 135282a

File tree

1 file changed

+116
-0
lines changed

1 file changed

+116
-0
lines changed
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
2+
R Under development (unstable) (2024-12-28 r87474) -- "Unsuffered Consequences"
3+
Copyright (C) 2024 The R Foundation for Statistical Computing
4+
Platform: aarch64-apple-darwin24.2.0
5+
6+
R is free software and comes with ABSOLUTELY NO WARRANTY.
7+
You are welcome to redistribute it under certain conditions.
8+
Type 'license()' or 'licence()' for distribution details.
9+
10+
R is a collaborative project with many contributors.
11+
Type 'contributors()' for more information and
12+
'citation()' on how to cite R or R packages in publications.
13+
14+
Type 'demo()' for some demos, 'help()' for on-line help, or
15+
'help.start()' for an HTML browser interface to help.
16+
Type 'q()' to quit R.
17+
18+
> ### examples from investigating UBSAN reports in vcdExtra::seq_loglm
19+
>
20+
> x <- margin.table(Titanic, 1)
21+
> ## Next two had UBSAN reports in R 4.5.0 from using --x on a 0-length R-allocated array.
22+
> loglin(x, NULL)
23+
0 iterations
24+
$lrt
25+
[1] 475.8113
26+
27+
$pearson
28+
[1] 467.8069
29+
30+
$df
31+
[1] 3
32+
33+
$margin
34+
NULL
35+
36+
> loglin(x, list())
37+
0 iterations
38+
$lrt
39+
[1] 475.8113
40+
41+
$pearson
42+
[1] 467.8069
43+
44+
$df
45+
[1] 3
46+
47+
$margin
48+
list()
49+
50+
>
51+
> loglin(x, list(1))
52+
2 iterations: deviation 0
53+
$lrt
54+
[1] 0
55+
56+
$pearson
57+
[1] 0
58+
59+
$df
60+
[1] 0
61+
62+
$margin
63+
$margin[[1]]
64+
[1] "Class"
65+
66+
67+
>
68+
> ## failed in R 4.4.2 as R code assumed >= 2 parameters
69+
> loglin(x, NULL, param = TRUE)
70+
0 iterations
71+
$lrt
72+
[1] 475.8113
73+
74+
$pearson
75+
[1] 467.8069
76+
77+
$df
78+
[1] 3
79+
80+
$margin
81+
NULL
82+
83+
$param
84+
$param$`(Intercept)`
85+
[1] 6.310373
86+
87+
88+
> loglin(x, list(1), param = TRUE)
89+
2 iterations: deviation 0
90+
$lrt
91+
[1] 0
92+
93+
$pearson
94+
[1] 0
95+
96+
$df
97+
[1] 0
98+
99+
$margin
100+
$margin[[1]]
101+
[1] "Class"
102+
103+
104+
$param
105+
$param$`(Intercept)`
106+
[1] 6.195379
107+
108+
$param$Class
109+
1st 2nd 3rd Crew
110+
-0.4115541 -0.5428901 0.3642359 0.5902083
111+
112+
113+
>
114+
> proc.time()
115+
user system elapsed
116+
0.068 0.012 0.078

0 commit comments

Comments
 (0)