a. The R command qt(x,8) calculates the cumulative distribution function of the t-distribution with 8 degrees of freedom.
b. For a goodness of fit test the test statistic to be used is $Y^2 = \sum_{i=1}^{k} \frac{(O_i - E_i)^2}{E_i}$ if the theory is based on a quadratic PDF.
c. A Z-test can be used instead of a T-test in very good approximation if the number of degrees of freedom is bigger than 30.
d. A test statistic is a suitable function of some random variables $X_1, X_2, \dots, X_n$ and as such has a given probability distribution. However, if I choose a particular sample then I get a realization of these random variables and the test statistic then takes on a particular value.
e. If I provide a theory that calculates theoretical expectations of frequencies to be $E_1 = 17.1$, $E_2 = 13.4$, $E_3 = 11.7$, $E_4 = 7.8$, $E_5 = 6.3$, $E_6 = 2.5$, $E_7 = 2.3$, and the formula for the PDF that I use in my theory uses the sample mean of the data as a parameter, then I have to regroup my data into 5 categories and the degrees of freedom to be used for a goodness of fit test are given by $\nu = 3$.