Page 8
Page 8
————————————————————————————————————————————
(1) Use the rt(n, df ) function in r to investigate the t-distribution for n = 100 and df = n − 1 and plot
(2) Use the rchisq(n, df ) function in r to investigate the chi-square distribution with n = 100 and
df = 2, 10, 25.
(3) Generate a vector of 100 values between -6 and 6. Use the dt() function in r to find the values of a
t-distribution given a random variable x and degrees of freedom 1,4,10,30. Using these values plot
the density function for students t-distribution with degrees of freedom 30. Also shows a comparison
(i) To find the 95th percentile of the F -distribution with (10, 20) degrees of freedom.
(ii) To calculate the area under the curve for the interval [0, 1.5] and the interval [1.5, +∞) of
(iii) To calculate the quantile for a given area (= probability) under the curve for a F -curve
with v1 = 10 and v2 = 20 that corresponds to q = 0.25, 0.5, 0.75 and 0.999. (use the qf ())
(iv) To generate 1000 random values from the F -distribution with v1 = 10 and v2 = 20 (use