tag:blogger.com,1999:blog-2159205108979523204.post6218781005794610952..comments2017-11-29T07:29:21.847-08:00Comments on R in Ecology and Evolution: Confidence Intervals for Regression plotCampitornoreply@blogger.comBlogger24125tag:blogger.com,1999:blog-2159205108979523204.post-10630912668097746222016-04-14T09:58:32.267-07:002016-04-14T09:58:32.267-07:00I'm having the same issue.I'm having the same issue.Drew Sheafferhttps://www.blogger.com/profile/09476240521496373385noreply@blogger.comtag:blogger.com,1999:blog-2159205108979523204.post-63458135903231456992016-04-04T07:29:27.887-07:002016-04-04T07:29:27.887-07:00Hey, what you missed is a coma
[1] supposed to be ...Hey, what you missed is a coma<br />[1] supposed to be [,1] to include all rows. In this case, x and y lengths are equal.Mohammed Al-haddihttps://www.blogger.com/profile/00439404209887029738noreply@blogger.comtag:blogger.com,1999:blog-2159205108979523204.post-17819100608502705672016-03-27T14:04:06.361-07:002016-03-27T14:04:06.361-07:00Am getting the same thing, the dotted line that re...Am getting the same thing, the dotted line that represents the CI lines looks like it has been overwrittenn multiple times in a similar location, but just off enough to create a linear 'scribble.' Does not cross the regression line. Colleen Khttps://www.blogger.com/profile/11849555596751357671noreply@blogger.comtag:blogger.com,1999:blog-2159205108979523204.post-14286936997410954572016-03-27T14:01:02.930-07:002016-03-27T14:01:02.930-07:00Hi,
I am trying to replicate this part of the cod...Hi,<br /><br />I am trying to replicate this part of the code:<br /><br />a <- predict(mod1, newdata=data.frame(larea=newx), interval="prediction")<br /><br />OR <br /><br />a <- predict(mod1, newdata=data.frame(larea=newx), interval="confidence")<br /><br />And I am getting the following error:<br /><br />"Error: unexpected '=' in "newx <- predict(mod1, newdata=data.frame(larea="<br /><br />I'm not sure where it thinks the error is. Any ideas? TYColleen Khttps://www.blogger.com/profile/11849555596751357671noreply@blogger.comtag:blogger.com,1999:blog-2159205108979523204.post-70665619787973460992016-01-07T17:54:13.746-08:002016-01-07T17:54:13.746-08:00Every time I visit your blog it really completes m...Every time I visit your blog it really completes my day, and hey its not a joke. I am telling the truth. Thank you for always inspiring us and for writing a very touching article.<br /><br /><a href="http://www.n8fan.net" rel="nofollow">zandra</a><br /><br />www.n8fan.net Silvia Jacintohttps://www.blogger.com/profile/00391915680800427200noreply@blogger.comtag:blogger.com,1999:blog-2159205108979523204.post-2057646392726687402015-08-29T10:40:41.579-07:002015-08-29T10:40:41.579-07:00Hello, thanks for the useful and understandable sc...Hello, thanks for the useful and understandable script. If possible I would like to keep using the range that is generated from my actual data and not start adding sequenced numbers. This is because when I keep having errors with the numbers of rows of the sequence, related to the range of my data (min/max) and wind up playing with the interval step (changing 0.01). Is there a way to use "confidence" with original data but to make a smooth line? I tend to get many layers, like a spider web on top of each other (not crossing regr line).<br /><br />Thanks <br /><br />spinningpedalshttps://www.blogger.com/profile/17275255986145373042noreply@blogger.comtag:blogger.com,1999:blog-2159205108979523204.post-16453164902292678092015-06-15T15:33:27.894-07:002015-06-15T15:33:27.894-07:00@Moreno-Bernal
That can probably be fixed if you e...@Moreno-Bernal<br />That can probably be fixed if you extend the x and y limits with xlim and ylim. The procedure stated above should create confidence intervals for the same length as the regression slope.Campitorhttps://www.blogger.com/profile/11076510437582306671noreply@blogger.comtag:blogger.com,1999:blog-2159205108979523204.post-53267581629640085012015-06-15T15:32:11.466-07:002015-06-15T15:32:11.466-07:00@Cidy Dy.
thank you for your comments.@Cidy Dy.<br /><br />thank you for your comments.Campitorhttps://www.blogger.com/profile/11076510437582306671noreply@blogger.comtag:blogger.com,1999:blog-2159205108979523204.post-16043371654746606192015-06-02T23:37:15.876-07:002015-06-02T23:37:15.876-07:00I like the way on how you put up your blogs. Wonde...I like the way on how you put up your blogs. Wonderful and awesome. Hope to read more post from you in the future. Goodluck. Happy blogging!<br /><br /><a href="http://www.gofastek.com" rel="nofollow">Bubble</a><br />www.gofastek.com<br />Cindy Dyhttps://www.blogger.com/profile/11708398102654526740noreply@blogger.comtag:blogger.com,1999:blog-2159205108979523204.post-39277753860939035652015-03-01T14:26:58.343-08:002015-03-01T14:26:58.343-08:00Thank you very much for your help! Your method wor...Thank you very much for your help! Your method worked almost perfectly. <br /><br /><br />The only inconvenient is that for some of the plots, the confidence band lines did not extend to the end of the data range. How can I solve this?Jorge W. Moreno-Bernalhttps://www.blogger.com/profile/07976192263827652422noreply@blogger.comtag:blogger.com,1999:blog-2159205108979523204.post-71422693067187345232015-01-13T23:12:54.301-08:002015-01-13T23:12:54.301-08:00Thanks, I have been working on this problem for a ...Thanks, I have been working on this problem for a couple of hours this afternoon and found this approach so much easier than several others I was given! Just one change because I was using Rcmdr and submitting all at once (after developing the model) is that I changed one of the "a <-" paragraphs to read b<- etc so the PI's were different to CI's.<br />LynetteLynettehttps://www.blogger.com/profile/17668753376490489441noreply@blogger.comtag:blogger.com,1999:blog-2159205108979523204.post-56804653348348361752014-08-28T12:46:05.179-07:002014-08-28T12:46:05.179-07:00Please note that when you create a confidence band...Please note that when you create a confidence band for the entire regression line, you ought to adjust for simultaneous estimation, e.g. by using the Working-Hotelling procedure.mandihttps://www.blogger.com/profile/13364369788715392365noreply@blogger.comtag:blogger.com,1999:blog-2159205108979523204.post-66139064675044485012013-09-24T22:50:15.433-07:002013-09-24T22:50:15.433-07:00Hi, should this work if you want confidence interv...Hi, should this work if you want confidence intervals on the partial regression plots, i.e. added-variable plots?<br />Ruth Malletthttps://www.blogger.com/profile/07295295524608598646noreply@blogger.comtag:blogger.com,1999:blog-2159205108979523204.post-81189351721227164452013-09-13T08:30:46.000-07:002013-09-13T08:30:46.000-07:00How would one go about filling in the area between...How would one go about filling in the area between the upper and lower limit Jfrei006https://www.blogger.com/profile/11738049310901274841noreply@blogger.comtag:blogger.com,1999:blog-2159205108979523204.post-38356847376921074752013-05-09T17:39:45.173-07:002013-05-09T17:39:45.173-07:00Thank you ! it was so useful ! cheers !Thank you ! it was so useful ! cheers !José Carrozahttps://www.blogger.com/profile/03603121214610920731noreply@blogger.comtag:blogger.com,1999:blog-2159205108979523204.post-46821290997772400492012-07-12T08:11:52.372-07:002012-07-12T08:11:52.372-07:00# Oh my, stupid me!
# There we go:
predict(mod1,...# Oh my, stupid me!<br /># There we go:<br /><br /><br />predict(mod1, interval="confidence")<br />a <- predict(mod1, interval="confidence")<br />lines(larea, a[,2], lty=2)<br />lines(larea, a[,3], lty=2)<br /><br />newx <- seq(min(larea), max(larea), 0.1)<br />a <- predict(mod1, newdata=data.frame(larea=newx), interval="prediction")<br />lines(newx, a[,2], lty=2, col="red")<br />lines(newx, a[,3], lty=2, col="green")<br /><br />a <- predict(mod1, newdata=data.frame(larea=newx), interval="confidence")<br />lines(newx, a[,2], lty=1, col="darkred")<br />lines(newx, a[,3], lty=1, col="darkgreen")botanischhttps://www.blogger.com/profile/08828571103212110358noreply@blogger.comtag:blogger.com,1999:blog-2159205108979523204.post-87585192920683458772012-07-12T07:43:47.928-07:002012-07-12T07:43:47.928-07:00# I'm confused: I copied and ran
# the code, ...# I'm confused: I copied and ran <br /># the code, and R still complains:<br /><br />> Error in xy.coords(x, y) : 'x' and 'y' lengths differ<br /><br />#Had a look at the lengths: <br />dim(a)<br />> [1] 74 3<br /><br />#So, I tried for the fun of it:<br />newx <- seq(min(larea), max(larea), length.out=7)<br /><br />#Reproduces the behaviour<br />#described by Veronica.<br /># Q: Did the R core team <br /># change something I missed? <br /># Or am I missing a point here?<br /># BWT, using my own data, <br /># same thing happens. <br /># Tried restarting R several times.<br /><br /># Running 2.15.0<br /># on x86_64-pc-mingw32/x64 (64-bit)botanischhttps://www.blogger.com/profile/08828571103212110358noreply@blogger.comtag:blogger.com,1999:blog-2159205108979523204.post-90790147264972290222012-05-31T14:53:41.376-07:002012-05-31T14:53:41.376-07:00Thanks, Dalton, my confidence intervals were looki...Thanks, Dalton, my confidence intervals were looking suspiciously narrow until I changed the interval from "confidence" to "prediction". And thanks to Campitor for posting this, it worked like a charm!sunshhttps://www.blogger.com/profile/13507503851005338244noreply@blogger.comtag:blogger.com,1999:blog-2159205108979523204.post-90068991806271874802012-02-26T23:24:19.945-08:002012-02-26T23:24:19.945-08:00For the second part of this plot you need to chang...For the second part of this plot you need to change interval to "prediction." The standard errors are slightly larger for prediction intervals rather than confidence interval. Confidence intervals are valid where you have x values in your data set. For possible x values not present in your dataset, you need to use a prediction interval.Daltonhttps://www.blogger.com/profile/13835855193294645501noreply@blogger.comtag:blogger.com,1999:blog-2159205108979523204.post-6741558187424593182012-02-26T23:23:35.856-08:002012-02-26T23:23:35.856-08:00For the second part of this plot you need to chang...For the second part of this plot you need to change interval to "prediction." The standard errors are slightly larger for prediction intervals rather than confidence interval. Confidence intervals are valid where you have x values in your data set. For possible x values not present in your dataset, you need to use a prediction interval.Daltonhttps://www.blogger.com/profile/13835855193294645501noreply@blogger.comtag:blogger.com,1999:blog-2159205108979523204.post-21414578050020601362011-12-08T11:06:03.126-08:002011-12-08T11:06:03.126-08:00Glad it helped.Glad it helped.Campitorhttps://www.blogger.com/profile/11076510437582306671noreply@blogger.comtag:blogger.com,1999:blog-2159205108979523204.post-79965405719849640082011-12-07T14:35:11.058-08:002011-12-07T14:35:11.058-08:00Thank you that was so useful!!Thank you that was so useful!!Audrée Morinhttps://www.blogger.com/profile/16664962185625184982noreply@blogger.comtag:blogger.com,1999:blog-2159205108979523204.post-78502927701319379902011-03-23T09:19:19.659-07:002011-03-23T09:19:19.659-07:00By zig-sagging you mean they cross the regression ...By zig-sagging you mean they cross the regression line? It does seem like you are mixing the upper and lower confidence limits. Maybe you can post (here) some of your code. That might help.Campitorhttps://www.blogger.com/profile/11076510437582306671noreply@blogger.comtag:blogger.com,1999:blog-2159205108979523204.post-50833345012009887032011-03-22T09:31:21.031-07:002011-03-22T09:31:21.031-07:00I am having problems with the confidence interval ...I am having problems with the confidence interval lines zigzagging. I know i need to sort the upr and lwr confidence limit columns to straighten the curves out but havent been successful yet.Veronicahttps://www.blogger.com/profile/03167188536698558949noreply@blogger.com