[R] How to read prediction intervals given by predict()?

Jeff Newmiller jdnewmil at dcn.davis.ca.us
Sat Oct 15 23:01:02 CEST 2016


No, you need to specify the inputs corresponding to the next value in order to obtain a production for that point. Read ?predict.lm or whatever function is appropriate for your model about the newdata argument. 
-- 
Sent from my phone. Please excuse my brevity.

On October 15, 2016 8:24:35 AM PDT, mviljamaa <mviljamaa at kapsi.fi> wrote:
>My conception of prediction intervals is the following:
>
>"a prediction interval gives an interval within which we expect next
>y_i 
>to lie with a specified probability"
>
>So when using predict() for my model:
>
>predict(fit4, interval="prediction")[1:20,]
>
>I get:
>
>         fit      lwr      upr
>1  491.1783 381.3486 601.0081
>2  515.4883 405.7128 625.2638
>3  581.5957 447.9569 715.2344
>4  522.4979 412.5086 632.4872
>5  604.6008 492.2796 716.9221
>6  520.2881 410.3108 630.2655
>7  620.7379 507.9045 733.5713
>8  621.0925 505.8731 736.3119
>9  527.1810 417.2760 637.0859
>10 519.4651 406.1622 632.7680
>11 622.0051 512.0082 732.0021
>12 536.6924 424.3415 649.0434
>13 504.8618 394.9034 614.8202
>14 545.5920 433.6530 657.5309
>15 475.6153 362.4383 588.7923
>16 462.5341 350.6090 574.4593
>17 559.0888 448.1212 670.0564
>18 544.0051 432.0583 655.9519
>19 471.1450 355.2377 587.0523
>20 604.3028 470.6925 737.9130
>
>Now since the prediction interval gives the interval within which the 
>_next_ y_i will fall, then how to read the above results? Does the 
>previous row's "lwr" and "upr" refer to the next row's "fit"'s
>interval?
>
>______________________________________________
>R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list