How would I go about creating a line from the t-table in R, after running a simulation for a t distribution? In essence, I want to perform the qt function using only values calculated from a random sample from the normal distribution, rather than using the confidence levels as inputs.
I have run a simulation on a t(degrees of freedom “df”) distribution 5000 times, and I want to take these values and use them to recreate the line in the t-table corresponding to the df. Having trouble trying to figure it out.
Any help is greatly appreciated!
The quantile function will give you the values equivalent to those in the t-tables I have used:
These are the areas to the left, the common t-tables give the area to the right, we can change the labels to match this with
names(t.table) <- 1-quants. Changequantsto match your particular table (and increase the number of simulations if you want closer matches).The simulation in this case could possibly be sped up by simulating a whole matrix of normals in 1 step then using tools like
rowMeans.