Page 118 - Applied Statistics Using SPSS, STATISTICA, MATLAB and R
P. 118
3.5 Estimating a Variance Ratio 97
Commands 3.5. MATLAB and R commands for obtaining confidence intervals of
a variance.
MATLAB civar(v,n,alpha)
R civar(v,n,alpha)
As an illustration we show the application of the R function civar to the Example
3.7:
> civar(0.7168,50,0.05)
[,1]
[1,] 0.5001708
[2,] 1.1130817
3.5 Estimating a Variance Ratio
In statistical tests of hypotheses, concerning more than one distribution, one often
needs to compare the respective distribution variances. We now present the topic
2
2
of estimating a confidence interval for the ratio of two variances, σ 1 and σ 2 , based
on sample variances, v 1 and v 2, computed on datasets of size n 1 and n 2,
respectively. We assume normal distributions for the two populations from where
the data samples were obtained. We use the sampling distribution of the ratio:
v 1 /σ 1 2 , 3.21
v 2 /σ 2 2
which has the F n 1 − , 1 2 n 1 − distribution as mentioned in the section B.2.9 (Property 6).
Thus, the 1–α two-sided confidence interval of the variance ratio can be
computed as:
v /σ 2 1 v σ 2 1 v
F α 2 / ≤ 1 1 ≤ F 1 α 2 / ⇒ 1 ≤ 1 ≤ 1 , 3.22
−
v 2 /σ 2 2 F 1 α− 2 / v 2 σ 2 2 F α 2 / v 2
where we dropped the mention of the degrees of freedom from the F percentiles in
order to simplify notation. Note that due to the asymmetry of the F distribution,
one needs to compute two different percentiles in two-sided interval estimation.
The confidence intervals for the variance ratio are computed by SPSS,
STATISTICA, MATLAB and R as part of hypothesis tests presented in the
following chapter. We also provide the MATLAB and R function
civar2(v1,n1,v2,n2,alpha) for computing confidence intervals of a
variance ratio (see Appendix F).