Function providing the fitted means, linear predictors, precisions or variances for mixed Poisson regression models.

# S3 method for mixpoissonreg
fitted(object, type = c("response", "link", "precision", "variance"), ...)

Arguments

object

object of class "mixpoissonreg" containing results from the fitted model.

type

the type of variable to get the fitted values. The default is the "response" type, which provided the estimated values for the means. The type "link" provides the estimates for the linear predictor of the mean. The type "precision" provides estimates for the precision parameters whereas the type "variance" provides estimates for the variances.

...

Currently not used.

Value

A vector containing the fitted values of a mixpoissonreg object.

See also

Examples

# \donttest{ data("Attendance", package = "mixpoissonreg") daysabs_fit <- mixpoissonreg(daysabs ~ gender + math + prog | gender + math + prog, data = Attendance) fitted(daysabs_fit)
#> 1 2 3 4 5 6 7 8 #> 5.249554 6.661619 8.915540 9.154674 10.043298 6.361844 6.707698 7.808208 #> 9 10 11 12 13 14 15 16 #> 5.683400 2.476910 3.565250 6.885712 6.278203 9.361429 3.206188 4.419806 #> 17 18 19 20 21 22 23 24 #> 8.126700 8.073101 7.326407 7.756711 8.856738 5.319490 6.072204 5.249554 #> 25 26 27 28 29 30 31 32 #> 8.974731 8.474518 7.654731 8.856738 5.011938 7.230085 7.912232 8.400077 #> 33 34 35 36 37 38 39 40 #> 6.112518 6.153100 5.078709 8.915540 7.454777 4.568486 12.114378 8.073101 #> 41 42 43 44 45 46 47 48 #> 8.234967 8.126700 7.810365 6.574037 6.977447 8.511986 4.881018 6.193952 #> 49 50 51 52 53 54 55 56 #> 6.931428 5.954494 7.164597 5.390359 5.797352 7.072355 9.911256 5.462171 #> 57 58 59 60 61 62 63 64 #> 11.797931 11.955107 8.740297 8.073101 6.402313 8.511986 7.308247 5.874586 #> 65 66 67 68 69 70 71 72 #> 8.344676 6.444819 13.119184 9.276636 3.565250 7.407655 4.946045 4.722167 #> 73 74 75 76 77 78 79 80 #> 3.101844 6.795184 3.041714 14.297708 6.360087 5.112427 7.912232 8.856738 #> 81 82 83 84 85 86 87 88 #> 8.180654 4.753518 8.937693 5.390359 4.848826 10.542678 7.358799 9.338225 #> 89 90 91 92 93 94 95 96 #> 1.964837 6.661619 8.511986 6.404081 4.219747 9.805255 9.525457 7.260047 #> 97 98 99 100 101 102 103 104 #> 6.977447 7.405611 6.032156 7.860048 10.404071 6.235074 7.308247 7.808208 #> 105 106 107 108 109 110 111 112 #> 7.673752 8.511986 15.479332 6.797061 5.952850 6.318140 4.753518 9.977059 #> 113 114 115 116 117 118 119 120 #> 6.931428 6.705847 5.952850 7.456836 8.073101 14.778675 5.722712 7.808208 #> 121 122 123 124 125 126 127 128 #> 7.654731 6.767141 7.308247 4.568486 4.390655 6.361844 14.109733 7.758852 #> 129 130 131 132 133 134 135 136 #> 6.707698 8.126700 7.556179 8.400077 9.977059 6.318140 9.867629 6.885712 #> 137 138 139 140 141 142 143 144 #> 5.954494 6.278203 5.045213 13.032658 9.338225 6.154799 14.876793 5.390359 #> 145 146 147 148 149 150 151 152 #> 8.400077 6.979373 7.606345 7.166576 8.740297 12.861315 6.112518 5.759116 #> 153 154 155 156 157 158 159 160 #> 12.117723 9.933141 13.560506 11.566032 6.235074 5.608679 3.565250 2.349198 #> 161 162 163 164 165 166 167 168 #> 2.349198 2.318313 3.612748 7.758852 2.141343 2.962260 2.141343 2.754299 #> 169 170 171 172 173 174 175 176 #> 2.057990 6.404081 2.461253 2.318313 2.228071 8.455847 2.057990 2.228071 #> 177 178 179 180 181 182 183 184 #> 2.700161 4.136805 3.001724 2.629629 6.979373 11.417123 3.734278 1.964837 #> 185 186 187 188 189 190 191 192 #> 2.700161 2.004232 11.045556 2.664662 5.180537 11.646036 2.560232 2.595056 #> 193 194 195 196 197 198 199 200 #> 3.834440 9.154674 5.285866 9.740586 2.526572 6.979373 6.532483 2.461253 #> 201 202 203 204 205 206 207 208 #> 2.754299 3.809151 3.565250 2.257755 7.606345 2.735378 9.361429 2.349847 #> 209 210 211 212 213 214 215 216 #> 11.879538 2.809523 2.923314 1.991014 10.270122 2.257755 2.629629 2.526572 #> 217 218 219 220 221 222 223 224 #> 3.248902 6.797061 6.361844 2.846952 7.758852 7.164597 3.784028 5.462171 #> 225 226 227 228 229 230 231 232 #> 7.262051 4.881018 2.611564 1.926217 2.198778 5.285866 6.707698 2.846952 #> 233 234 235 236 237 238 239 240 #> 2.736134 2.057990 10.001850 6.033822 3.834440 6.994784 6.617683 3.834440 #> 241 242 243 244 245 246 247 248 #> 2.884084 6.195662 2.884881 2.646356 6.444819 7.212164 3.041714 8.234967 #> 249 250 251 252 253 254 255 256 #> 6.360087 2.809523 3.336966 2.611564 8.400077 2.577229 6.114206 3.082237 #> 257 258 259 260 261 262 263 264 #> 3.271375 2.444345 2.198778 2.476910 7.966962 2.228071 9.174889 7.407655 #> 265 266 267 268 269 270 271 272 #> 8.093161 3.495172 1.926217 2.085408 6.979373 2.287833 7.522918 2.754299 #> 273 274 275 276 277 278 279 280 #> 2.273372 2.113190 2.213376 5.462171 2.057990 2.412209 2.113190 1.964837 #> 281 282 283 284 285 286 287 288 #> 4.598816 2.629629 2.560232 2.595056 8.587419 3.293094 2.526572 8.073101 #> 289 290 291 292 293 294 295 296 #> 2.884881 2.664662 2.510601 6.072204 3.541736 7.356768 2.287833 5.285866 #> 297 298 299 300 301 302 303 304 #> 7.827611 3.472120 2.754299 2.461253 2.155560 5.462171 2.560232 3.685183 #> 305 306 307 308 309 310 311 312 #> 2.257755 9.652358 2.257755 2.962260 3.228366 6.705847 2.595056 6.887614 #> 313 314 #> 2.412875 2.629629
fitted(daysabs_fit, type = "precision")
#> 1 2 3 4 5 6 7 8 #> 0.8176375 0.9832333 1.2552681 1.2812563 1.3765258 0.9666461 1.0070860 1.1118693 #> 9 10 11 12 13 14 15 16 #> 0.8694796 0.6267246 0.8465066 1.0087441 0.9567924 2.7725211 0.7653272 0.7156718 #> 17 18 19 20 21 22 23 24 #> 1.1683908 1.1624205 2.2509670 1.1061878 1.2488538 0.8260581 0.9151836 0.8176375 #> 25 26 27 28 29 30 31 32 #> 1.2617153 2.5195126 1.0949117 1.2488538 0.7888359 2.2280214 1.1233201 1.1987056 #> 33 34 35 36 37 38 39 40 #> 0.9198841 0.9246087 0.7969598 1.2552681 1.0727032 0.7342404 3.3224631 1.1624205 #> 41 42 43 44 45 46 47 48 #> 1.1804237 1.1683908 1.1330233 0.9732106 1.0191327 1.2110507 0.7728356 0.9293576 #> 49 50 51 52 53 54 55 56 #> 1.0139251 0.9183721 1.0402322 0.8345653 0.8829458 1.0492177 1.3624940 0.8431602 #> 57 58 59 60 61 62 63 64 #> 3.2550723 3.2885951 1.2361234 1.1624205 0.9534706 1.2110507 1.0563429 0.8920389 #> 65 66 67 68 69 70 71 72 #> 1.1925804 0.9583677 3.6003428 1.2944515 0.8465066 1.0875264 0.7807947 0.7532909 #> 73 74 75 76 77 78 79 80 #> 0.7459723 0.9984613 0.7485713 3.8482858 0.9485984 0.8010531 1.1233201 1.2488538 #> 81 82 83 84 85 86 87 88 #> 1.1743918 0.7571599 2.6748577 0.8345653 0.7688865 2.9835797 1.0819692 1.3011000 #> 89 90 91 92 93 94 95 96 #> 0.5238487 0.9832333 1.2110507 0.9716109 0.6904619 2.8737503 1.3212509 1.0509451 #> 97 98 99 100 101 102 103 104 #> 1.0191327 1.0672218 0.9105071 1.1175800 2.9531661 0.9341309 1.0563429 1.1118693 #> 105 106 107 108 109 110 111 112 #> 2.3331534 1.2110507 4.0922853 1.0174576 0.9012257 0.9437512 0.7571599 1.3694920 #> 113 114 115 116 117 118 119 120 #> 1.0139251 0.9882833 0.9012257 1.0931120 1.1624205 3.9481326 0.8905727 1.1118693 #> 121 122 123 124 125 126 127 128 #> 1.0949117 2.1167547 1.0563429 0.7342404 0.7120148 0.9666461 3.8090577 1.1272337 #> 129 130 131 132 133 134 135 136 #> 1.0070860 1.1683908 1.1043696 1.1987056 1.3694920 0.9437512 2.8345807 1.0087441 #> 137 138 139 140 141 142 143 144 #> 0.9183721 0.9567924 0.7928874 3.5819454 1.3011000 0.9422000 3.9684107 0.8345653 #> 145 146 147 148 149 150 151 152 #> 1.1987056 1.0385224 1.1100418 1.0600232 1.2361234 3.5454323 0.9198841 0.8784341 #> 153 154 155 156 157 158 159 160 #> 3.3856750 2.8491394 3.6937565 3.2054277 0.9341309 0.8606164 0.8465066 0.6015582 #> 161 162 163 164 165 166 167 168 #> 0.6015582 0.5954261 0.8552244 1.1272337 0.5599243 0.7333877 0.5599243 0.6932022 #> 169 170 171 172 173 174 175 176 #> 0.5429752 0.9716109 0.6353850 0.5954261 0.5774024 1.2048623 0.5429752 0.5774024 #> 177 178 179 180 181 182 183 184 #> 0.6826299 0.6799313 0.7409406 0.6687838 1.0385224 3.2331163 0.8774139 0.5238487 #> 185 186 187 188 189 190 191 192 #> 0.6826299 0.5319619 3.1513520 0.6756714 0.8093028 3.2831896 0.6429854 0.6619665 #> 193 194 195 196 197 198 199 200 #> 0.8955793 1.2812563 0.8374730 2.8590658 0.6364311 1.0385224 0.9866589 0.6353850 #> 201 202 203 204 205 206 207 208 #> 0.6932022 0.8910030 0.8465066 0.5833489 1.1100418 0.6767838 2.7725211 0.6130032 #> 209 210 211 212 213 214 215 216 #> 3.3340385 0.7039383 0.7259118 0.5292436 2.9786756 0.5833489 0.6687838 0.6364311 #> 217 218 219 220 221 222 223 224 #> 0.7732090 1.0174576 0.9666461 0.7111879 1.1272337 1.0402322 0.8864501 0.8431602 #> 225 226 227 228 229 230 231 232 #> 1.0709400 0.7728356 0.6529438 0.5158592 0.5715166 0.8374730 1.0070860 0.7111879 #> 233 234 235 236 237 238 239 240 #> 0.6896600 0.5429752 2.9182580 0.9278301 0.8955793 2.1716756 0.9782091 0.8955793 #> 241 242 243 244 245 246 247 248 #> 0.7050972 0.9470392 0.7185121 0.6596682 0.9583677 1.0455749 0.7485713 1.1804237 #> 249 250 251 252 253 254 255 256 #> 0.9485984 0.7039383 0.8042323 0.6529438 1.1987056 0.6462879 0.9373854 0.7562805 #> 257 258 259 260 261 262 263 264 #> 0.7919666 0.6203360 0.5715166 0.6267246 1.1505712 0.5774024 2.6792616 1.0875264 #> 265 266 267 268 269 270 271 272 #> 2.4770082 0.8335961 0.5158592 0.5485671 1.0385224 0.5893566 2.2975695 0.6932022 #> 273 274 275 276 277 278 279 280 #> 0.5975006 0.5542166 0.5744520 0.8431602 0.5429752 0.6140125 0.5542166 0.5238487 #> 281 282 283 284 285 286 287 288 #> 0.7380116 0.6687838 0.6429854 0.6619665 2.5454601 0.7960342 0.6364311 1.1624205 #> 289 290 291 292 293 294 295 296 #> 0.7185121 0.6756714 0.6452256 0.9151836 0.8421810 1.0617684 0.5893566 0.8374730 #> 297 298 299 300 301 302 303 304 #> 2.3692885 0.8293366 0.6932022 0.6353850 0.5628001 0.8431602 0.6429854 0.8684699 #> 305 306 307 308 309 310 311 312 #> 0.5833489 1.3348580 0.5833489 0.7333877 0.7838936 0.9882833 0.6619665 1.0279360 #> 313 314 #> 0.6256944 0.6687838
# } daysabs_prog <- mixpoissonreg(daysabs ~ prog, data = Attendance) fitted(daysabs_prog)
#> 1 2 3 4 5 6 7 8 #> 6.934132 6.934132 6.934132 6.934132 6.934132 6.934132 6.934132 6.934132 #> 9 10 11 12 13 14 15 16 #> 6.934132 2.672897 2.672897 6.934132 6.934132 10.650000 2.672897 6.934132 #> 17 18 19 20 21 22 23 24 #> 6.934132 6.934132 10.650000 6.934132 6.934132 6.934132 6.934132 6.934132 #> 25 26 27 28 29 30 31 32 #> 6.934132 10.650000 6.934132 6.934132 6.934132 10.650000 6.934132 6.934132 #> 33 34 35 36 37 38 39 40 #> 6.934132 6.934132 6.934132 6.934132 6.934132 6.934132 10.650000 6.934132 #> 41 42 43 44 45 46 47 48 #> 6.934132 6.934132 6.934132 6.934132 6.934132 6.934132 6.934132 6.934132 #> 49 50 51 52 53 54 55 56 #> 6.934132 6.934132 6.934132 6.934132 6.934132 6.934132 6.934132 6.934132 #> 57 58 59 60 61 62 63 64 #> 10.650000 10.650000 6.934132 6.934132 6.934132 6.934132 6.934132 6.934132 #> 65 66 67 68 69 70 71 72 #> 6.934132 6.934132 10.650000 6.934132 2.672897 6.934132 6.934132 6.934132 #> 73 74 75 76 77 78 79 80 #> 2.672897 6.934132 2.672897 10.650000 6.934132 6.934132 6.934132 6.934132 #> 81 82 83 84 85 86 87 88 #> 6.934132 6.934132 10.650000 6.934132 6.934132 10.650000 6.934132 6.934132 #> 89 90 91 92 93 94 95 96 #> 2.672897 6.934132 6.934132 6.934132 6.934132 10.650000 6.934132 6.934132 #> 97 98 99 100 101 102 103 104 #> 6.934132 6.934132 6.934132 6.934132 10.650000 6.934132 6.934132 6.934132 #> 105 106 107 108 109 110 111 112 #> 10.650000 6.934132 10.650000 6.934132 6.934132 6.934132 6.934132 6.934132 #> 113 114 115 116 117 118 119 120 #> 6.934132 6.934132 6.934132 6.934132 6.934132 10.650000 6.934132 6.934132 #> 121 122 123 124 125 126 127 128 #> 6.934132 10.650000 6.934132 6.934132 6.934132 6.934132 10.650000 6.934132 #> 129 130 131 132 133 134 135 136 #> 6.934132 6.934132 6.934132 6.934132 6.934132 6.934132 10.650000 6.934132 #> 137 138 139 140 141 142 143 144 #> 6.934132 6.934132 6.934132 10.650000 6.934132 6.934132 10.650000 6.934132 #> 145 146 147 148 149 150 151 152 #> 6.934132 6.934132 6.934132 6.934132 6.934132 10.650000 6.934132 6.934132 #> 153 154 155 156 157 158 159 160 #> 10.650000 10.650000 10.650000 10.650000 6.934132 6.934132 2.672897 2.672897 #> 161 162 163 164 165 166 167 168 #> 2.672897 2.672897 2.672897 6.934132 2.672897 2.672897 2.672897 2.672897 #> 169 170 171 172 173 174 175 176 #> 2.672897 6.934132 2.672897 2.672897 2.672897 6.934132 2.672897 2.672897 #> 177 178 179 180 181 182 183 184 #> 2.672897 6.934132 2.672897 2.672897 6.934132 10.650000 2.672897 2.672897 #> 185 186 187 188 189 190 191 192 #> 2.672897 2.672897 10.650000 2.672897 6.934132 10.650000 2.672897 2.672897 #> 193 194 195 196 197 198 199 200 #> 2.672897 6.934132 6.934132 10.650000 2.672897 6.934132 6.934132 2.672897 #> 201 202 203 204 205 206 207 208 #> 2.672897 2.672897 2.672897 2.672897 6.934132 2.672897 10.650000 2.672897 #> 209 210 211 212 213 214 215 216 #> 10.650000 2.672897 2.672897 2.672897 10.650000 2.672897 2.672897 2.672897 #> 217 218 219 220 221 222 223 224 #> 2.672897 6.934132 6.934132 2.672897 6.934132 6.934132 2.672897 6.934132 #> 225 226 227 228 229 230 231 232 #> 6.934132 6.934132 2.672897 2.672897 2.672897 6.934132 6.934132 2.672897 #> 233 234 235 236 237 238 239 240 #> 2.672897 2.672897 10.650000 6.934132 2.672897 10.650000 6.934132 2.672897 #> 241 242 243 244 245 246 247 248 #> 2.672897 6.934132 2.672897 2.672897 6.934132 6.934132 2.672897 6.934132 #> 249 250 251 252 253 254 255 256 #> 6.934132 2.672897 2.672897 2.672897 6.934132 2.672897 6.934132 2.672897 #> 257 258 259 260 261 262 263 264 #> 2.672897 2.672897 2.672897 2.672897 6.934132 2.672897 10.650000 6.934132 #> 265 266 267 268 269 270 271 272 #> 10.650000 2.672897 2.672897 2.672897 6.934132 2.672897 10.650000 2.672897 #> 273 274 275 276 277 278 279 280 #> 2.672897 2.672897 2.672897 6.934132 2.672897 2.672897 2.672897 2.672897 #> 281 282 283 284 285 286 287 288 #> 6.934132 2.672897 2.672897 2.672897 10.650000 2.672897 2.672897 6.934132 #> 289 290 291 292 293 294 295 296 #> 2.672897 2.672897 2.672897 6.934132 2.672897 6.934132 2.672897 6.934132 #> 297 298 299 300 301 302 303 304 #> 10.650000 2.672897 2.672897 2.672897 2.672897 6.934132 2.672897 2.672897 #> 305 306 307 308 309 310 311 312 #> 2.672897 6.934132 2.672897 2.672897 2.672897 6.934132 2.672897 6.934132 #> 313 314 #> 2.672897 2.672897