Homework #9 Problem 2

The returns of two portfolios were recorded for ten years. Portfolio 1 had a varaince of returns of 295, while portfolio 2 had a variance of 105. Can you conclude at a 5% level of significance that portfolio 1 is riskier than portfolio 2?

The test statistic for testing this claim will have the following distribution _______

The value of the test statistic for testing the hypothesis is _______

The p-value associated is _______

Based on your results, what is your conclusion?

Construct a 95% confidence interval for the true ratio of portfolio variances.

Answer

The test statistic follows an F distribution with 13 and 13 degrees of freedom. Returns were recorded for 10 years. So \(n_{1}=10\) and \(n_{2}=10\). Also, \(s_{1}^{2}=295\) and \(s_{2}^{2}=105\). The F statistic is equal to 2.8095.

n1<-10
n2<-10
df1<-n1-1
df2<-n2-1
s1_2<-295
s2_2<-105
Fstat<-s1_2/s2_2
Fstat
## [1] 2.809524

To find the associated p-value:

############### Working with the upper tail -> Same as using Excel (FDIST)
p_value<-pf(Fstat, df1 , df2, lower.tail=FALSE)

Therefore, you do not reject the null and conclude that there is not enough evidence to claim that the variation in portfolio 1 is greater than in portfolio 2.

what_to_do<-ifelse(p_value<0.05, "reject","don't")
what_to_do
## [1] "don't"

Those are the LCL and UCL from the 95% confidence interval:

## Confidence Interval -> Working with the upper tail -> Same as using Excel (FINV)
Fc1<-qf(0.975, df1, df2, lower.tail = FALSE)
Fc2<-qf(0.025, df1, df2, lower.tail = FALSE)
min<-Fstat/Fc2
max<-Fstat/Fc1
min
## [1] 0.697846
max
## [1] 11.31113

Homework #9 Problem 5

Recall that in order to perform the “Furniture World” example (page 42), you assumed that the population variances were equal. Now you can formally test whether that assumption was correct. Perform the F-test yourself based on the data in the Excel file.

Which of the following are true for this test?

What is the p-value for this test?

Can you conclude at 5% level that variances are unequal?

Answer

The test \(H_{0}\) is “variances are the same”, and \(H_{1}\) is “variances are different”. The p-value is equal to .299. Hence, you do not reject the null and assume the variances are equal.

library(xlsx)

furniture<-read.xlsx("furniture_design_v1.xlsx", sheetName = "Sheet1", as.data.frame = T, header = T)

s1_2<-var(furniture$Design.A)
s2_2<-var(furniture$Design.B)

n1<-25
n2<-25
df1<-n1-1
df2<-n2-1
Fstat<-s1_2/s2_2
Fstat
## [1] 0.6505935
#### Working with the upper tail -> Same as using Excel
pf(Fstat, df1, df2, lower.tail = FALSE)
## [1] 0.8503944
p_value1<-2*(1-pf(Fstat, df1, df2, lower.tail = FALSE))

p_value1
## [1] 0.2992113
#### Working with the lower tail (no need to take 1-pf)
p_value2<-2*pf(Fstat, df1, df2, lower.tail = TRUE)
p_value2
## [1] 0.2992113