- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to find critical value for one-sided and two-sided t test in R?
To find the critical value for t test in R, we need to use qt function. This function requires level of significance and the sample size and returns the tabulated or critical value of t distribution. Below examples shows the calculation of critical value for different situations such as left-side test, right-side test or two-sided test.
Left side critical value with sample size 30 and 95% confidence level −
Example
qt(0.05,30)
Output
[1] -1.697261
Right side critical value with sample size 30 and 95% confidence level −
Example
abs(qt(0.05,30))
Output
[1] 1.697261
Example
qt(0.05,50)
Output
[1] -1.675905
Example
abs(qt(0.05,50))
Output
[1] 1.675905
Example
qt(0.01,50)
Output
[1] -2.403272
Example
abs(qt(0.01,50))
Output
[1] 2.403272
Example
qt(0.01,51)
Output
[1] -2.401718
Example
abs(qt(0.01,51))
Output
[1] 2.401718
Example
qt(0.01,100)
Output
[1] -2.364217
Example
abs(qt(0.01,100))
Output
[1] 2.364217
Example
qt(0.01,20)
Output
[1] -2.527977
Example
abs(qt(0.01,20))
Output
[1] 2.527977
Example
qt(0.10,36)
Output
[1] -1.305514
Example
abs(qt(0.10,36))
Output
[1] 1.305514
Two-sided critical value for 90% confidence level with sample size of 36 −
Example
abs(qt(0.10/2,36))
Output
[1] 1.688298
Example
abs(qt(0.01/2,101))
Output
[1] 2.625386
Example
abs(qt(0.05/2,89))
Output
[1] 1.986979
Advertisements