1. In R, inverse probability distribution functions start with q (no reason why really; it’s just a convention). To calculate the critical value for a two-tailed t-test with n − k = 100 and α = 0.05, use the inverse t distribution command. For the inverse t function, type qt(1-0.05/2, 100). To find the one-tailed critical value for a t distribution for α = 0.01 and 100 degrees of freedom, type qt(1-0.01, 100).
2. To find the critical value from a normal distribution for a given a, use the inverse normal function in R. For a two-sided test, type qnorm(1-a/2). For a one-sided test, type display qnorm(1-a).
3.The p-value reported in summary(lm(Y ∼ X1)) is a two-sided p-value. To generate the p values from the t statistic only, use 2*(1-pt(abs(TSTAT), DF)), where TSTAT is the observed value of the t statistic and DF is the degrees of freedom. For example, for a two-sided p-value for a t statistic of 4.23 based on 1,908 degrees of freedom, type 2*(1-pt(abs(4.23), 1908)).
Get Answers For Free
Most questions answered within 1 hours.