# How Do You Do This R Code Problem

How do you do this R-code problem?

Obtain an approximation to the t distribution by Monte Carlo simulation. To fix ideas, let n=10. Step S: Generate X1,…,Xn i.i.d. N(0,1) and compute the t-statistic: T = sqrt{n}* barX / hatSigma where barX is the sample mean and hatSigma the sample standard deviation, i.e., the square root of the sample variance. Repeat Step S many times (say 499 times), and collect the 499 values of T in a vector denoted by VT. Plot a histogram of VT and compare it to a plot of the t distribution with m=n-1. Also compute the Monte Carlo approximation to qt(0.975,m) by using the R command: quantile(VT, 0.975).

t Distribution ProjectQuestionObtain an approximation to the t distribution by Monte Carlo simulation. To fixideas, let n=10 .ii d Step S: GenerateT =√ n× X 1 , .. . , X n ∼ N (0 ,1) and…

## Leave a Reply

Want to join the discussion?Feel free to contribute!