Calculation of prediction interval for a new observation
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (1)
Star Strider
am 11 Jan. 2022
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 Kommentare
Star Strider
am 14 Jan. 2022
‘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.
Siehe auch
Kategorien
Mehr zu Repeated Measures and MANOVA finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!