# GUIvar

GUIvar shows the necessary calculations to obtain the variance in a GUI.

## Syntax

• out=GUIvar(x)example
• out=GUIvar(x,w)example

## Description

 out =GUIvar(x) Variance of the first 6 natural numbers.

 out =GUIvar(x, w) Calculation of variance (using n as denominator).

## Examples

expand all

### Variance of the first 6 natural numbers.

x=1:6;
out=GUIvar(x);

### Calculation of variance (using n as denominator).

See page 9 of [CMR]

x=[427 492 445 444 476 470];
y=GUIvar(x,1);

## Related Examples

expand all

### Example of weighted variance.

See page 128 of [MRZ]

x=[25:50:175 250 400 750];
w=[59 69 31 25 8 3 1];
out=GUIvar(x,w);

## Input Arguments

### x — vector of numeric data. Vector.

Vector containing strictly numerical data.

Data Types: double

### w — weights. Vector or scalar.

Vector of the same length of x containing the weights assigned to each observation or scalar which specifies the normalization to use If w=1 the denominator of the index corresponds to the number of observations.

If w=0 (default), the denominator of the index corresponds to the number of observations minus 1. If w is not supplied we assume that all observations have weight equal to 1 and the index is normalized with length(x)-1.

Example: 1:10 

Data Types: double

## Output Arguments

### out —detailed output to compute the index. Table

Table with n+1 rows (where n is the length of x) containing what is shown in the GUI. Last row contains the totals.

## References

Milioli, M.A., Riani, M., Zani, S. (2019), "Introduzione all'analisi dei dati statistici (Quarta edizione ampliata)". [MRZ]

Cerioli, A., Milioli, M.A., Riani, M. (2016), "Esercizi di statistica (Quinta edizione)". [CMR]