0

I am trying to use a Monte Carlo simulation to obtain a t statistic on two vectors. I don't know how to put a specific vector in.

I tried using the MonteCarlo package and minrunif()

noNBA <- c(7.2, 10.5, 6, 8, 8, 9.5, 9, 11, 11.2, 8.3)

NBA <- c(8, 6.7, 8.4, 9.3, 9.1, 6, 7.4, 5.7)

These are the two vectors, so I tried this code for one vector

min(runif(noNBA)) [1] 0.07535907

but I got a decimal value.

I should be obtaining a t-statistic somewhere around 1-2. But not sure how to get a t-statistic from a monte carlo sim.

Collin
  • 11
  • 2
  • Are you following a guide or something? If so, maybe you could provide that information. Otherwise I'm really not sure what you are trying to do here. I'm not sure if this is a programming question or a question about how to use statistical methods. You're asking for a t-statistic but I'm not even sure what hypothesis you are testing. – MrFlick May 22 '19 at 15:02
  • Mile times of people who watch NBA games on TV. Null hypothesis = Mean mile time of people who watch NBA games on TV equals the mean mile time of people who don't watch NBA games on TV. Alternative hypothesis = Mean mile time of people who watch NBA games on TV is different from those who don't. – Collin May 22 '19 at 15:04
  • I have to calculate a t statistic using a monte carlo simulation to see if i can/cannot reject my null – Collin May 22 '19 at 15:05
  • You "have" to? Is this a homework assignment? If so it would be better to ask your professor for help understanding exactly what concepts they want you to learn. – MrFlick May 22 '19 at 15:06

0 Answers0