In R, how to use pt( ) to find the one-sided left-tail p-value for t=-1.98 with df=8? And what is the one-sided right-tail p-value for t=1.98 with df=8? And what is the two-sided p-value for t=1.98 with df=8?
Print the code please, thank you!
To get one sided left tail p-value for t= -1.98 with df 8, the R-code is:
pt(-1.98,8,lower.tail = TRUE)
[1] 0.04152436
(When lower.tail= TRUE you get the probability to the left of the distribution)
To get one sided right tail p-value for t= 1.98 with df 8, the R-code is:
pt(1.98,8,lower.tail = FALSE)
[1] 0.04152436
(When lower.tail= FALSE you get the probability to the right of the distribution)
To get two sided right tail p-value for t= 1.98 with df 8, the R-code is:
2*pt(1.98,8,lower.tail = FALSE)
[1] 0.08304872
Get Answers For Free
Most questions answered within 1 hours.