0

I have an assignment to test out some hypothesis... To simplyfy this, lets say there are 433 out of 1044 and I have to check whether the rate increases or not / differs from 23%.

null: rate <= 0.23
alternative: rate > 0.23

I did choose a t.test:

data = c(0.23, 0.23, 0.23, 433/1044)
t.test(data, mu = 0.23, alternative = "greater", level=0.95)

I get a p-Value of like 0.19. -> This indicates I have to accept H0. (5% confidence.level) The T Value is 1.

This is a contradiction to this:

t value >= qt(p=0.95, df = length(data)-1, lower.tail = F) <--- This however indicates I have to decline H0...

What is the true answer now in this case?

Am I missing something out right here?

HappyR
  • 43
  • 9
  • 3
    Wait. `qt(p=0.95, df = length(data)-1, lower.tail = T)` returns `2.353` and your t value is 1 (and 1 is not greater than 2.353) so you fail to reject (you never "accept H0", you either reject or fail to reject). I don't see a contradiction here. If you have questions about statistics, you should ask them at [stats.se]. Stack Overflow is for questions about programming. – MrFlick Mar 21 '17 at 14:43
  • 2
    You shouldn't be using a t.test and even if you were your code isn't correctly set up to do the test you want to do. I'm not really sure where you got the idea that you pass in a vector of 4 values to do a simple test of a proportion. But I agree with @MrFlick in that you seem to have some misconceptions and the core of your question isn't really suitable for stackoverflow. – Dason Mar 21 '17 at 14:47
  • hey thank you first of all, I didnt know of Cross Validated, beside that I was mistyping, I used lower.tail = F, I just did lower.tail = T to test out. If not using the t.test, what test would be appropiate? I just got those information, last 3 years 23% and that one year 41%. – HappyR Mar 21 '17 at 15:09

0 Answers0