Usually, the prediction interval has this shape in the image.  I don't know why the end of the interval is wider than the center.
3446
I have noticed that the confidence interval for predicted values in an linear regression tends to be narrow around the mean of the predictor and fat around the minimum and maximum values of the predictor. This can be seen in plots of these 4 linear regressions:    I initially thought this was because most values of the predictors were concentrated around the mean of the predictor. However, I then noticed that the narrow middle of the confidence interval would occur even if many values of were concentrated around the extremes of the predictor, as in the bottom left linear regression, which lots of values of the predictor are concentrated around the minimum of the predictor.  is anyone able to explain why confidence intervals for the predicted values in an linear regression tend to be narrow in the middle and fat at the extremes?
103348
I have an issue with the answer given in this .  As suggested in the comments to its answer, I modified the solution as follows:  \documentclass{article} \usepackage{tikz} \usetikzlibrary{shapes.geometric, arrows} \usetikzlibrary{calc,positioning}  \newcounter{image} \setcounter{image}{0}  \tikzstyle{square} = [draw, rectangle, draw=black, minimum width=1cm, minimum height=1cm, text centered]  \tikzset{drawinside/.code args={#1}{         \draw($(#1.west)!0.3!(#1.center)$)--($(#1.east)!0.3!(#1.center)$);         \draw($(#1.south)!0.3!(#1.center)$)--($(#1.north)!0.3!(#1.center)$);         \draw($(#1.south west)!0.4!(#1.west)!0.3!(#1.center)$)--($(#1.south west)!0.165!(#1.west)!0.5!(#1.center)$)--(#1.center);         \draw(#1.center)--($(#1.north east)!0.165!(#1.east)!0.65!(#1.center)$)--($(#1.north east)!0.45!(#1.east)!0.45!(#1.center)$);                } }  \tikzset{record/.style args={#1 and #2}{         rectangle,draw,minimum width=#1, minimum height=#2     } }  \newcommand{\drawrecord}[1] { \stepcounter{image} { \node [record=1 cm and 1 cm, name=a\theimage] at {#1}; } \node[drawinside={a\theimage}]{}; }  \begin{document} \begin{tikzpicture}  \drawrecord{0,0};  \node (sq) [square] {}; \drawrecord{sq};  \end{tikzpicture} \end{document}   but I keep receiving a ! Package tikz Error: Cannot parse this coordinate. error when I call \drawrecord  . how may I solve this issue?  . Is there a way to define \drawrecord as a \tikzstyle instead of a new command?  EDIT:  for the second question, I have been suggested to look into "append after command", but I cannot find documentation about it, anyone has a link?  EDIT2: actually, the second question is kind of redundant, I can simply call  \node [record=1 cm and 1 cm, name=newnode, right of=oldnode]; \node[drawinside={newnode}]{};   in my document. And  \tikzset{drawinside/.code args={#1}{     \draw($(#1.west)!0.3!(#1.center)$)--($(#1.east)!0.3!(#1.center)$);     \draw($(#1.south)!0.3!(#1.center)$)--($(#1.north)!0.3!(#1.center)$);     \draw($(#1.south west)!0.4!(#1.west)!0.3!(#1.center)$)--($(#1.south west)!0.165!(#1.west)!0.5!(#1.center)$)--(#1.center);     \draw(#1.center)--($(#1.north east)!0.165!(#1.east)!0.5!(#1.center)$)--($(#1.north east)!0.4!(#1.east)!0.3!(#1.center)$);             } }   is symmetrical (the previous one is slightly off)
21645
the point represents rates like 10%, etc. (this was also pretty clear from 2 years ago) -- been trying to do this for 2 yrs...  the points dont represent numbers of events since they are rates ()    but the points have geo ids so they are attached to location, not distance (whatever distance is to imply) -- update: it represents z-value but we're just dealing with rates
71336
For a prediction interval in linear regression you still use $\hat{E}[Y|x] = \hat{\beta_0}+\hat{\beta}_{1}x$ to generate the interval. You also use this to generate a confidence interval of $E[Y|x_0]$. What's the difference between the two?
51618
I am fitting a linear model to a problem, and a little confused by what is going on. Without the details here are the two plots confusing me:  Residuals vs Fitted    Residuals vs Y    Now the residuals vs fitted looks good to me. Fairly evenly dispersed, no clear pattern. However, the $y$ vs fitted do not look good. I would have expected there to also not be a clear trend in this relationship.   This seems basic, but I'm rather lost. I don't want to fit a model that allows large positive errors at high values of $Y$ to make up for large negative errors at low values of $Y$.  Is this just an indication of a poorly fitting model? Or is something else going on here?  EDIT: Asked for fitted vs y (changed to have labels)    EDIT2: Just want to point out that this question has already been asked and answered (albeit in a more abstract sense)  .
119859
I have a model similar to below with a continuous outcome, continuous predictor and a categorical variable. the goal of this analysis is to make inferences on the group variable. The issue is that y is bounded by x in the form of y >= -x. When the model makes predictions you can see in the plot below that the predicted value is outside the possible range. See the last plot.   How can this be remedied? A custom loss function to penalize going beyond the bound and use gradient descent regression? Or is there some other way? Thank you.   x =   rep(seq(-10,10,1),each=5)  y =  rep(0,length(x) ) weights = sample( seq(1,1000,1) ,length(x)) groups = rep( letters[1:5], times =length(x)/5  )   ## the outcome y has the relationship y &gt;= -x for(i in 1:length(x)){   y[i] = sample(  seq(-x[i],-x[i]+ ifelse(x[i]&lt;0 ,                                            sample(seq(1,10,.1),1),                                           sample(seq(5,40,.1),1) ),1)                        ,1) }   dat =data.frame(x = x, y = y, weights = weights, group = groups) model = lm(dat = dat, y ~ x + group + group * x, weights = weights) dat$FIT= predict(model, dat, allow.new.levels = TRUE)  library(ggplot2) ggplot(data = dat, aes(x = x, y = y, color = group))+geom_point( aes(size = weights))+ geom_line(data = dat, aes(x = x, y = FIT, color = group))    #data for new predictions newdata = data.frame( x = seq(-100,100,1) ,                        group = rep("c", length( seq(-100,100,1) )),                       bound = -seq(-100,100,1)                       )  ## when pridicting new data the outcome y has the relationship y &gt;= -x ## but the predicted vales are below the bound. See how red line is below blue to the left of zero new_preds  = predict(model, newdata, allow.new.levels = TRUE) ggplot(data = newdata, aes(x = x, y = new_preds, color = group))+geom_line()  +   geom_line(data = newdata, aes(x = x, y = bound, color = "green"))
16825
What causes the different results below?    var1 = c(0.04875,0.13725,0.28350,0.50975,0.77425,0.94700,0.05325,0.14050,0.29725,0.51525,0.79000,0.95400,0.04625,0.15250,0.29000,0.53300,0.79825,0.95225,0.05025,0.14625,0.28800,0.52625,0.78200,0.95925,0.04700,0.14225,0.30325,0.53500,0.79325,0.95875,0.04775,0.13850,0.28675,0.54250,0.78300,0.95175,0.05150,0.12725,0.30175,0.54725,0.79475,0.96275,0.05375,0.14100,0.30050,0.53275,0.78100,0.96175,0.05450,0.15300,0.29650,0.52850,0.80100,0.95675,0.05425,0.13975,0.30875,0.56025,0.80575,0.96100,0.05100,0.15350,0.31175,0.53300,0.78900,0.96000,0.04650,0.13525,0.29600,0.53625,0.78475,0.96375,0.05375,0.13900,0.29600,0.53725,0.78700,0.95800,0.05075,0.14350,0.29225,0.54525,0.80275,0.95800,0.05050,0.13200,0.29850,0.52700,0.80525,0.96150,0.05150,0.14050,0.29450,0.54375,0.79450,0.96375,0.05375,0.13525,0.30475,0.55250,0.79425,0.96025,0.04950,0.14500,0.29425,0.52250,0.78475,0.95650,0.05225,0.14425,0.29225,0.53150,0.80425,0.95375)  var2 = c(1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,4,5,6)  var3 = c(4,4,4,4,4,4,6,6,6,6,6,6,8,8,8,8,8,8,10,10,10,10,10,10,12,12,12,12,12,12,14,14,14,14,14,14,16,16,16,16,16,16,18,18,18,18,18,18,20,20,20,20,20,20,22,22,22,22,22,22,24,24,24,24,24,24,26,26,26,26,26,26,28,28,28,28,28,28,30,30,30,30,30,30,32,32,32,32,32,32,34,34,34,34,34,34,36,36,36,36,36,36,38,38,38,38,38,38,40,40,40,40,40,40)   summary(aov(var1~as.factor(var2)*var3)) summary(aov(var1~as.factor(poly(var2,1))*poly(var3,1)))   I might not understand well how poly(..) and I(..) work. Could you give me some hints about these two functions?  (I aim to create models of different degree (quadratic, cubic, etc..) and compare their BIC (or AIC)).
25578
The following produces error! The error is solved if no space exists between text= and {5in,8in}. This is really weird! Why is this happening with LaTeX?  \documentclass[a4paper,10pt,onecolumn,oneside, portrait]{article}  \usepackage[text= {5in,8in},centering]{geometry}  \begin{document}      \section{What Endogenous uncertainty is:}  yes  \subsection{Type as it is : Stochastic and determ! } on  \subsubsection{Well there is more than it} Yes    \end{document}
50431
Why the log? Is it there to make the growth of the function slower?  As this is a common experimental observable, it doesn't seem reasonable to take the range from $[0,\infty)$ to $(-\infty,\infty)$ (For a particle emitted along the beam axis after collision $\theta = 0$ wouldn't be better to have a number that says how close it is to zero rather than one that says how large a number it is. I hope that makes the question clear.)
103877
Well, you can see it for yourself. The badge multiplier is a bit misaligned. Can you fix this please? (I know it's kinda a minor issue but it's bugging me and it's somehow off)    If it helps, I'm using Chrome version 44.0.2403.125 m. (Also repro'ed on FireFox 39.0 and )    For no good reason, that's a screenie from 's profile page.
5087
I have a figure that is wider than the \textwidth of my document. (I don't want to change the \textwidth.) As a result, the leftmost part of the figure is flush with the left margin, while the rightmost part spills into the right margin too much. I'd like to center the figure, so that it will exceed the \textwidth equally on both sides.
2900
It's supposed to be zero but for some reason the result produces a peculiar series of digits at the end.  Also, here's the .xlsx of it: http://83.212.111.36/Book1.xlsx
9563
The tooltips in the Posts graph on the  are misplaced. Sometimes, they appear to be part of the next graph (see below) - the arrow indicates the point I was hovering over.  This could be caused by the new responsive design; when I originally reported the bug, I checked two other sites (Ask Different and Chess) which didn't have the new design back then, and there the tooltips appeared reasonably close to the data point (the bottom right one in ).
43054
I saw an example on a blog where a k nearest neighbors algorithm was run to predict responses on a test data set.The MSE(mean squared error) of the predictions was larger than the variance of the response variable in the test set. Shouldn't the MSE always be less than the variance of the response variable as SSTO(total sum of squares) = RSS(model sum of squares) + SSE(error sum of squares).
10793
The model is vivisected right down the middle along the z axis. The right leg is rendering funny and I assume if I can get that fixed everything else will fall into place. I tried flipping normals, changing shading types - can't think of anything else to do.
85998
Why is the area under the ROC curve the probability that a classifier will rank a randomly chosen "positive" instance (from the retrieved predictions) higher than a randomly chosen "positive" one (from the original positive class)? How does one prove this statement mathematically using integral, giving the CDFs and PDFs of the true positive and negative class distributions?
107119
I tried reading  about histograms, but couldn't understand it well enough to answer this question.  I took some shots yesterday where the main peak of my Histogram was actually off the chart. The histogram had one large peak and most everything else was very low. What exactly does this mean, and if it's something bad (I expect that it is) how can I avoid this in the future?  Here is the Histogram in question :    and the image can be found  (Update: I altered the photo, so the link is taking into account Jrista's excellent suggestions. This histogram no longer corresponds to this photo.)