I need to determine the critical t values for one-sided tails of 75% and 99%, for 40 degrees of freedom.
The following is code for a two-sided 99% critical t values:
qt(0.01, 40)
but how can I determine for a one-sided critical t value?
You can use the qt() function to find the critical value of t in R. The function gives the critical value of t for the one-tailed test. If you want the critical value of t for a two-tailed test, divide the significance level by two.
A critical-T value is a “cut-off point” on the t distribution. A t-distribution is a probability distribution that is used to calculate population parameters when the sample size is small and when the population variance is unknown. T values are used to analyze whether to support or reject a null hypothesis.
The critical value for a 95% confidence interval is 1.96, where (1-0.95)/2 = 0.025.
The code you posted gives the critical value for a one-sided test (Hence the answer to you question is simply:
abs(qt(0.25, 40)) # 75% confidence, 1 sided (same as qt(0.75, 40))
abs(qt(0.01, 40)) # 99% confidence, 1 sided (same as qt(0.99, 40))
Note that the t-distribution is symmetric. For a 2-sided test (say with 99% confidence) you can use the critical value
abs(qt(0.01/2, 40)) # 99% confidence, 2 sided
Josh's comments are spot on. If you are not super familiar with critical values I'd suggest playing with qt, reading the manual (?qt
) in conjunction with looking at a look up table (LINK). When I first moved from SPSS to R I created a function that made critical t value look up pretty easy (I'd never use this now as it takes too much time and with the p values that are generally provided in the output it's a moot point). Here's the code for that:
critical.t <- function(){
cat("\n","\bEnter Alpha Level","\n")
alpha<-scan(n=1,what = double(0),quiet=T)
cat("\n","\b1 Tailed or 2 Tailed:\nEnter either 1 or 2","\n")
tt <- scan(n=1,what = double(0),quiet=T)
cat("\n","\bEnter Number of Observations","\n")
n <- scan(n=1,what = double(0),quiet=T)
cat("\n\nCritical Value =",qt(1-(alpha/tt), n-2), "\n")
}
critical.t()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With