Calculation of prediction interval for a new observation
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Star Strider
el 11 de En. de 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 comentarios
Star Strider
el 14 de En. de 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.
Ver también
Categorías
Más información sobre Repeated Measures and MANOVA en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!