Finding Variance from given table using formula

718 Views Asked by At

Im having trouble calculating the variance for $X_m$ and $X_k$ for the following table:

"We now consider a random household and let the stochastic variables $X_k$ og $X_m$ be defined in the following way: $X_k$: The woman's working hours measured in hours per. week $X_m$: The man's working hours measured in hours per. week" Table

I calculated the marginal distribution for Xm: $$ P(X_m = 0) = 0.08$$ $$P(X_m = 20) = 0.12$$ $$P(X_m = 40) = 0.8$$ I've already calculated the mean for $X_m$, which i did by using the marginal distribution values $$\text{mean} = 0.08 \cdot 0 +0.12 \cdot 20 +0.8 \cdot 40 =34.4$$

Now i am to calculate the Variance, however it seems as though there are multiple variance formulas available however im not sure which to use.

1

There are 1 best solutions below

0
On

There are two possible formulas for the variance. I will illustrate both.

Assuming $\mu = E(X_m) - 34.4,$ as you say, $V(X_m) = (.08)(0-34.4)^2 + (.12)(20-34.4)^2 +(.80)(40-34.4)^2 = 144.64.$

p = c(.08, .12, .8);  mu = 34.4
x = c(0,20,40)
sum(p*(x-mu)^2)
[1] 144.64

An alternate formula for the variance: $E(X_m^2) = (.08)0^2+(.12)20^2+(.8)40^2 = 1328$ $V(X_m) = E(X_m^2) - \mu^2 = 144.64.$

sum(p*x^2)
[1] 1328
1328 - 34.4^2
[1] 144.64

Simulation: As a check. With 10 million iterations, we can expect about four significant digits of accuracy. Thw mean of a very large sample should be approximately the same as the population mean. The variance of a very large sample should be approximately the same as the population variance. Agreement is satisfactory.

set.seed(226)
p = c(.08, .12, .8)
x.m = sample(c(0,20,40), 10^7, rep=T, p=p)
mean(x.m);  var(x.m)
[1] 34.39397     # aprx E(X.m) = 34.4
[1] 144.7988     # apro V(X.m) = 144.64