Calculation of prediction interval for a new observation
조회 수: 4 (최근 30일)
이전 댓글 표시
Hello,
does anyone know how the calculation of the 95% prediction interval for a new observation in the "grpstats"-function is performed? I can't find anything in the documentation. Is there any documentation availible?
If I have a set of values (x), is there an other way for calculating the prediction interval?
I can only find the calculation for regression models, but not for single vectors.
x = [95 84 105 96 86 86 95 94 75 93]';
Group = (ones(10,1));
T = table(x,Group,'VariableNames',{'Data','Group'});
statarray = grpstats(T,{'Group'},{'predci','meanci'},'DataVars',{'Data'});
댓글 수: 0
답변 (1개)
Star Strider
2022년 1월 11일
The code is not doing a regression, so the ±95% confidence intervals on the vector would be the confidence intervals on the mean, calculated here as ‘MeanCI’ and corresponding to 'meanci'. I am not certain that 'predci' is appropriate here because no regression is being calculated, as would be the situation in something like Plot Prediction Intervals for a New Observation in Each Group.
x = [95 84 105 96 86 86 95 94 75 93]';
Group = (ones(10,1));
T = table(x,Group,'VariableNames',{'Data','Group'})
statarray = grpstats(T,{'Group'},{'predci','meanci'},'DataVars',{'Data'})
MeanCI = std(x)/sqrt(numel(x)) * tinv([0.025 0.975],numel(x)-1) + mean(x)
.
댓글 수: 4
Star Strider
2022년 1월 14일
‘If 'predci' is not appropriate for a simple set of grouped values, it would not make sence that you can call it in the grpstats function?’
In the context of grpstats, the 'predci' option makes sense for regeressions, as the documentation demonstrates. There is no regression here. (This also applies to the paragraph that follows in your previous Comment.)
So 'meanci' applies to vectors of observations that are not regressions. Prediction intervals are appropriate only in the situation of a regression that actually predicts a future dependent variable oin the basis of a new independnet variable. That does not apply here.
참고 항목
카테고리
Help Center 및 File Exchange에서 Repeated Measures and MANOVA에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!