jumpint: Confidence intervals for jumps and confidence bands for step...

Description Usage Arguments Value Note See Also Examples

Description

Extract and plot confidence intervals and bands from fits given by a stepfit object.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
jumpint(sb, ...)
## S3 method for class 'stepfit'
jumpint(sb, ...)
## S3 method for class 'jumpint'
points(x, pch.left = NA, pch.right = NA, y.left = NA, y.right = NA, xpd = NA, ...)
confband(sb, ...)
## S3 method for class 'stepfit'
confband(sb, ...)
## S3 method for class 'confband'
lines(x, dataspace = TRUE, ...)

Arguments

sb

the result of a fit by stepbound

x

the object

pch.left, pch.right

the plotting character to use for the left/right end of the interval with defaults "(" and "]" (see parameter pch of par)

y.left, y.right

at which height to plot the interval boundaries with default par()$usr[3]

xpd

see par

dataspace

logical determining whether the expected value should be plotted instead of the fitted parameter value, useful e.g. for family = "binomial", where it will plot the fitted success probability times the number of trials per observation

...

arguments to be passed to generic methods

Value

For jumpint an object of class jumpint, i.e. a data.frame whose columns rightEndLeftBound and rightEndRightBound specify the left and right end of the confidence interval for the block's right end, resp., given the number of blocks was estimated correctly, and similarly columns rightIndexLeftBound and rightIndexRightBound specify the left and right indices of the confidence interval, resp. Function points plots these intervals on the lower horizontal axis (by default).

For confband an object of class confband, i.e. a data.frame with columns lower and upper specifying a confidence band computed at every point x; this is a simultaneous confidence band assuming the true number of jumps has been determined. Function lines plots the confidence band.

Note

Observe that jumps may occur immediately before or after an observed x; this lack of knowledge is reflected in the visual impressions by the lower and upper envelopes jumping vertically early, so that possible jumps between xs remain within the band, and by the confidence intervals starting immediately after the last x for which there cannot be a jump, cf. the note in the help for stepblock.

See Also

stepbound, points, lines

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# simulate Bernoulli data with four blocks
y <- rbinom(200, 1, rep(c(0.1, 0.7, 0.3, 0.9), each=50))
# fit step function
sb <- stepbound(y, family="binomial", param=1, confband=TRUE)
plot(y, pch="|")
lines(sb)
# confidence intervals for jumps
jumpint(sb)
points(jumpint(sb), col="blue")
# confidence band
confband(sb)
lines(confband(sb), lty=2, col="blue")

Example output

Successfully loaded stepR package version 2.0-3.
Several new functions are added in version 2.0-0. Some older functions are deprecated (still working) and may be defunct in a later version. Please read the documentation for more details.
  leftEndLeftBound leftEndRightBound rightEndLeftBound rightEndRightBound
1                1                 1                23                 68
2               24                69               119                177
3              120               178               200                200
  leftIndexLeftBound leftIndexRightBound rightIndexLeftBound
1                  1                   1                  23
2                 24                  69                 119
3                120                 178                 200
  rightIndexRightBound
1                   68
2                  177
3                  200
      x        lower     upper
1     1 0.0002818980 0.4000283
2     2 0.0002818980 0.4000283
3     3 0.0002818980 0.4000283
4     4 0.0002818980 0.4000283
5     5 0.0002818980 0.4000283
6     6 0.0002818980 0.4000283
7     7 0.0002818980 0.4000283
8     8 0.0002818980 0.4000283
9     9 0.0002818980 0.4000283
10   10 0.0002818980 0.4000283
11   11 0.0002818980 0.4000283
12   12 0.0002818980 0.4000283
13   13 0.0002818980 0.4000283
14   14 0.0002818980 0.4000283
15   15 0.0002818980 0.4000283
16   16 0.0002818980 0.4000283
17   17 0.0002818980 0.4000283
18   18 0.0002818980 0.4000283
19   19 0.0002818980 0.4000283
20   20 0.0002818980 0.4000283
21   21 0.0002818980 0.4000283
22   22 0.0002818980 0.4000283
23   23 0.0002818980 0.4000283
24   24 0.0002818980 0.5689112
25   25 0.0002818980 0.6019453
26   26 0.0002818980 0.6333200
27   27 0.0002818980 0.6632018
28   28 0.0002818980 0.6779370
29   29 0.0002818980 0.6779370
30   30 0.0008289599 0.6779370
31   31 0.0008289599 0.6779370
32   32 0.0008289599 0.6779370
33   33 0.0008289599 0.6779370
34   34 0.0008289599 0.6779370
35   35 0.0024300412 0.6779370
36   36 0.0024300412 0.6779370
37   37 0.0024300412 0.6779370
38   38 0.0024300412 0.6779370
39   39 0.0066653071 0.6779370
40   40 0.0066653071 0.6779370
41   41 0.0066653071 0.6779370
42   42 0.0066653071 0.6779370
43   43 0.0066653071 0.6779370
44   44 0.0142682451 0.6779370
45   45 0.0142682451 0.6779370
46   46 0.0142682451 0.6779370
47   47 0.0142682451 0.6779370
48   48 0.0142682451 0.6779370
49   49 0.0142682451 0.6779370
50   50 0.0142682451 0.6779370
51   51 0.0142682451 0.6779370
52   52 0.0214480438 0.6779370
53   53 0.0214480438 0.6779370
54   54 0.0214480438 0.6779370
55   55 0.0316035312 0.6779370
56   56 0.0433658265 0.6779370
57   57 0.0707007172 0.6779370
58   58 0.1295755327 0.6779370
59   59 0.1295755327 0.6779370
60   60 0.1295755327 0.6779370
61   61 0.1295755327 0.6779370
62   62 0.2091327834 0.6779370
63   63 0.2091327834 0.6779370
64   64 0.2151630516 0.6779370
65   65 0.2649125949 0.6779370
66   66 0.3220630500 0.6779370
67   67 0.3220630500 0.6779370
68   68 0.3599660161 0.6779370
69   69 0.4715208344 0.6779370
70   70 0.4715208344 0.6779370
71   71 0.4715208344 0.6779370
72   72 0.4715208344 0.6779370
73   73 0.4715208344 0.6779370
74   74 0.4715208344 0.6779370
75   75 0.4715208344 0.6779370
76   76 0.4715208344 0.6779370
77   77 0.4715208344 0.6779370
78   78 0.4715208344 0.6779370
79   79 0.4715208344 0.6779370
80   80 0.4715208344 0.6779370
81   81 0.4715208344 0.6779370
82   82 0.4715208344 0.6779370
83   83 0.4715208344 0.6779370
84   84 0.4715208344 0.6779370
85   85 0.4715208344 0.6779370
86   86 0.4715208344 0.6779370
87   87 0.4715208344 0.6779370
88   88 0.4715208344 0.6779370
89   89 0.4715208344 0.6779370
90   90 0.4715208344 0.6779370
91   91 0.4715208344 0.6779370
92   92 0.4715208344 0.6779370
93   93 0.4715208344 0.6779370
94   94 0.4715208344 0.6779370
95   95 0.4715208344 0.6779370
96   96 0.4715208344 0.6779370
97   97 0.4715208344 0.6779370
98   98 0.4715208344 0.6779370
99   99 0.4715208344 0.6779370
100 100 0.4715208344 0.6779370
101 101 0.4715208344 0.6779370
102 102 0.4715208344 0.6779370
103 103 0.4715208344 0.6779370
104 104 0.4715208344 0.6779370
105 105 0.4715208344 0.6779370
106 106 0.4715208344 0.6779370
107 107 0.4715208344 0.6779370
108 108 0.4715208344 0.6779370
109 109 0.4715208344 0.6779370
110 110 0.4715208344 0.6779370
111 111 0.4715208344 0.6779370
112 112 0.4715208344 0.6779370
113 113 0.4715208344 0.6779370
114 114 0.4715208344 0.6779370
115 115 0.4715208344 0.6779370
116 116 0.4715208344 0.6779370
117 117 0.4715208344 0.6779370
118 118 0.4715208344 0.6779370
119 119 0.4715208344 0.6779370
120 120 0.4715208344 0.6779370
121 121 0.4715208344 0.6917142
122 122 0.4715208344 0.7189495
123 123 0.4715208344 0.7350874
124 124 0.4715208344 0.7350874
125 125 0.4715208344 0.7350874
126 126 0.4715208344 0.7350874
127 127 0.4715208344 0.7350874
128 128 0.4715208344 0.7350874
129 129 0.4715208344 0.7848369
130 130 0.4715208344 0.7848369
131 131 0.4715208344 0.7848369
132 132 0.4715208344 0.7848369
133 133 0.4715208344 0.7848369
134 134 0.4715208344 0.7848369
135 135 0.4715208344 0.8284692
136 136 0.4715208344 0.8667198
137 137 0.4715208344 0.8667198
138 138 0.4715208344 0.8704245
139 139 0.4715208344 0.8704245
140 140 0.4715208344 0.8704245
141 141 0.4715208344 0.8734352
142 142 0.4715208344 0.9292993
143 143 0.4715208344 0.9664827
144 144 0.4715208344 0.9686904
145 145 0.4715208344 0.9686904
146 146 0.4715208344 0.9686904
147 147 0.4715208344 0.9832102
148 148 0.4715208344 0.9933347
149 149 0.4715208344 0.9975700
150 150 0.4715208344 0.9975700
151 151 0.4715208344 0.9975700
152 152 0.4715208344 0.9975700
153 153 0.4715208344 0.9975700
154 154 0.4715208344 0.9975700
155 155 0.4715208344 0.9975700
156 156 0.4715208344 0.9975700
157 157 0.4715208344 0.9975700
158 158 0.4715208344 0.9975700
159 159 0.4715208344 0.9975700
160 160 0.4715208344 0.9975700
161 161 0.4715208344 0.9991710
162 162 0.4715208344 0.9991710
163 163 0.4715208344 0.9991710
164 164 0.4715208344 0.9991710
165 165 0.4715208344 0.9991710
166 166 0.4715208344 0.9991710
167 167 0.4715208344 0.9991710
168 168 0.4715208344 0.9991710
169 169 0.4715208344 0.9991710
170 170 0.4715208344 0.9991710
171 171 0.4715208344 0.9991710
172 172 0.4715208344 0.9997181
173 173 0.4715208344 0.9997181
174 174 0.4715208344 0.9997181
175 175 0.5031503174 0.9997181
176 176 0.5031503174 0.9997181
177 177 0.5031503174 0.9997181
178 178 0.5999716794 0.9997181
179 179 0.5999716794 0.9997181
180 180 0.5999716794 0.9997181
181 181 0.5999716794 0.9997181
182 182 0.5999716794 0.9997181
183 183 0.5999716794 0.9997181
184 184 0.5999716794 0.9997181
185 185 0.5999716794 0.9997181
186 186 0.5999716794 0.9997181
187 187 0.5999716794 0.9997181
188 188 0.5999716794 0.9997181
189 189 0.5999716794 0.9997181
190 190 0.5999716794 0.9997181
191 191 0.5999716794 0.9997181
192 192 0.5999716794 0.9997181
193 193 0.5999716794 0.9997181
194 194 0.5999716794 0.9997181
195 195 0.5999716794 0.9997181
196 196 0.5999716794 0.9997181
197 197 0.5999716794 0.9997181
198 198 0.5999716794 0.9997181
199 199 0.5999716794 0.9997181
200 200 0.5999716794 0.9997181

stepR documentation built on Aug. 26, 2020, 5:11 p.m.