(ggplot(data = two_tests)+geom_line(aes(x = var_true, y = prob_T1_rejects, col ='Test 1'))+geom_line(aes(x = var_true, y = prob_T2_rejects, col ='Test 2'))+facet_wrap(~n, labeller = label_both)+scale_y_continuous(breaks =c(0.05, seq(0.25, 1, by =0.25)))+geom_hline(aes(yintercept =0.05), linetype =2)+theme_classic()+labs(x =expression(sigma[true]^2),y ='P(reject null)', color =''))
We see that when the true value of \(\sigma^2\) is 1, both tests have a rejection rate of 0.05, indicating they both have the same size. We see that for every other value of \(\sigma^2\), Test 1 has more power than Test 2, showing that T1 is uniformly more powerful than T2.
# visualize(ggplot(data = beta_decisions)+geom_line(aes(x = true_theta, y = prob_T1_rejects, col ='Test 1'))+geom_line(aes(x = true_theta, y = prob_T2_rejects, col ='Test 2'))+facet_wrap(~n, labeller = label_both)+scale_y_continuous(breaks =c(0.05, seq(0.25, 1, by =0.25)))+geom_hline(aes(yintercept =0.05), linetype =2)+theme_classic()+labs(x =expression(theta[true]),y ='P(reject null)', color =''))
We see that when the true value of \(\theta\) is 0.2, both tests have a rejection rate of 0.05, indicating they both have the same size. We see that for every other value of \(theta\), Test 1 has more power than Test 2, showing that T1 is uniformly more powerful than T2.