Do you use a chi-squared test or a t-test for equality of variances? How can I find if I should t-test or chi-squared test if I am given a problem like the following? 
Consider testing $H_0: \sigma^2_X = \sigma^2_Y$ against $H_1: \sigma^2_X ≠ \sigma^2_Y$ from two independent samples from normal populations with unknown means $\mu_X$ and $\mu_Y$ and standard deviations $\sigma_X$ and $\sigma_Y$. The $X$'s are 11.4, 9.7, 11.4, 13.3, 7.4, 8.5, 13.4, 17.4, 12.7. The $Y$'s are 3.2, 2.7, 5.5, -0.9, -1.8. Find the value of the test statistic.
P.S.: I know how to do the chisq.test and t.test when I just one hypothesis ($H_0$)! How should I write R script to do the above problem when I have more than one hypothesis? What are some good external R related script to this question that I can cover for seeing similar example?
> X = c( 11.4, 9.7, 11.4, 13.3, 7.4, 8.5, 13.4, 17.4, 12.7)
> Y = c(3.2, 2.7, 5.5, -0.9, -1.8)
> ?t.test
> t.test(X, Y)

    Welch Two Sample t-test

data:  X and Y
t = 5.9114, df = 8.306, p-value = 0.0003089
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
  6.092637 13.805141
sample estimates:
mean of x mean of y 
 11.68889   1.74000 

> chisq.test(X, Y)
Error in chisq.test(X, Y) : 'x' and 'y' must have the same length

 A: You do neither a T-test nor a $\chi^{2}$ test when testing $H_0: \sigma^{2}_X = \sigma^2_Y$ against $H_a: \sigma^{2}_X \neq \sigma^2_Y$. For testing the equality of variances between two normally distributed populations you use the F-test of equality of variances, which reformulates your test as $H_0: \frac{\sigma^{2}_X}{\sigma^2_Y} = 1$ against $H_a: \frac{\sigma^{2}_X}{\sigma^2_Y} \neq 1$. In R, you should run 
> X=c( 11.4, 9.7, 11.4, 13.3, 7.4, 8.5, 13.4, 17.4, 12.7)
> Y=c(3.2, 2.7, 5.5, -0.9, -1.8)
> var.test(x,y)

F test to compare two variances

data:  X and Y
F = 0.979, num df = 8, denom df = 4, p-value = 0.9033
alternative hypothesis: true ratio of variances is not equal to 1
95 percent confidence interval:
0.109 4.947
sample estimates:
ratio of variances 
         0.979

A: @Mona Jalal, There are various tests used for equality of variances, suited for different situations each having its advantages and limitations. The most common ones are 


*

*Bartlett's Test of Sphericity 

*Levene's test 

*F- Test  


While the post is continuously going back and forth here, may be you want to discuss them in a chat to elaborate about the problem you are facing or you can read about all three of them on Wikipedia.
After that if you face difficulty in implementing those test or interpreting the results  in R or Python, you can ask them here by rewording your question
A: The test you get with chisq.test is for counts - used to compare proportions or test for independence with categorical data, that kind of thing.
On the other hand, t-tests are usually for comparing means.
There is a test involving variances (a one sample variance test) with normal data that is a chisquare test but you don't get that test with that command.
With two samples and normal data there's a corresponding ratio-of-variances F test for testing equality of variances, but it's generally not recommended (it's not robust to violations of normality). Levene or Browne-Forsythe -- or a few others -- are more often used, typically corresponding to a form of ANOVA on deviations from some measure of location.
When those deviations are bigger on average it would correspond (under some reasonable assumptions) to the variances being bigger.
An equivalent to Levene or Browne-Forsythe could be performed with two-samples (on deviations from the mean or median, respectively) and could even be done as a t-test rather than an ANOVA.
A: Note that t.test is for a difference of means, when you actually want to test for a difference of variances based on the null and alternative hypotheses you set up. See:
?var.test
var.test(x, y)

